Rails71

Rails Object#with for Attribute Management

We can use Object#with method as shorthand for the common begin/ensure pattern to save the value of an attribute, setting a new value, and then restoring

Rails Object#in? Now Supports Open Ranges

We can use Object#in? method to check open date ranges i.e. beginless and endless ranges.

Introducing Line Range Filtering in Rails

Rails 7.1 introduces line range filtering for running specific tests within a test file based on line numbers.

Rails 7.1 secret_key_base in Credentials

Rails 7.1 stores secret_key_base in credentials instead of secrets, following the deprecation of the secrets API for enhanced security

Rails 7.1 assert_raises Matches Messages

Check the exception and the message raised by rails or custom errors in tests together with assert_raises in a single line.

Using picture_tag Helper in Rails 7.1

Support for picture_tag helper in Rails. Its usage, advantages, and use cases.

Rails 7.1 Rails.env.local? Method Explained

Rails 7.1 adds Rails.env.local? to check if environment is development or test in one simple call.

Rails 7.1 Postgres Enum Support Extended

Rails 7.1 extends support to rename enum, add enum value and rename enum value for Postgres adapter

Using quarter method by rails 7.1

Get quarter of the date provided for the current year or the custom year.

Customizing Rails Generators with Thor

Templates are an easy way to customize your Rails generators to fix repetitive tasks and make your life easier.