Rails

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.

Rails 7.1 after_discard for ActiveJob

Rails 7.1 introduces the after_discard method, allowing us to run a callback when a job is about to be discarded.

Rails 7.1 AR Transaction Instrumentation

With Rails 7.1, we can subscribe to ActiveRecord transaction events for instrumentation with the help of transaction.active_record.

Rails 7.1 Disallow Foreign Keys Option

With Rails 7.1, we can disable foreign key constraints for the entire application by adding foreign_keys false option to database.yml

Rails 7.1 Readonly Attribute Error

Rails 7.1 now raises an ActiveRecord::ReadonlyAttributeError on assignment to readonly attributes.

Rails 7.1 Multiple Mailer Preview Paths

Rails 7.1 adds support for multiple mailer preview paths, enhancing flexibility and organization by allowing previews across various directories.

Rails 7.1 Logs Job Enqueue Callers

Rails 7.1 ActiveJob logs background job enqueue callers with backtraces, showing the file and line number where jobs are triggered.