Rails

Rails 7.1 application.deprecators Method

Rails 7.1 adds Rails.application.deprecators for fine-grained control over deprecation warnings, including debug mode and silencing.

Rails 7.2 Job Scheduling in Transactions

In Rails 7.2, ActiveJob delays job enqueuing until the transaction is committed and drops the job if the transaction is rolled back.

Rails 7.1 Validators Accept Lambdas

With Rails 7.1, we can use lambdas without record argument with ActiveModel validators.

Rails 7.1 Array#intersect? for AR Relations

Rails 7.1 added Array#intersect? method which returns true if two ActiveRecord relation objects have at least one element in common, otherwise returns false.

Rails 7.1 Controller Generator --parent

With Rails 7.1, the controller generator now accepts the --parent option. This allows us to generate a controller that inherits from the specified parent class.

Rails 7.1 Reserved Attribute Name Error

Rails 7.1 raises error when we generate model with reserved attribute names.

Rails inverse_of in Associations

Explore the inverse_of option in Rails associations, highlighting its benefits in performance, data consistency, and optimizing bi-directional relationships.

Rails 7.1 --unused Routes Option

With Rails 7.1, identify and manage unused routes declared in the application by using bin/rails routes --unused option.

Rails 7.1 exclude? and extract_value Methods

Rails 7.1 adds exclude?, returning true if a key is missing from parameters. And extract_value, which splits a parameter value by delimiter into an array.

Rails 7.1 in_batches Descending Order Fix

With Rails 7.1, in_batches method without a block works fine for both `ASC/DESC` order values.