Articles by Keshav Biswa

Rails 7 adds ActiveRecord::Relation#structurally_compatible?

Rails 7 adds ActiveRecord::Relation#structurally_compatible? to provide an easy way to check if two relations are structurally compatible before running `or` or `and` query on it.

Rails 7 optimizes remove_columns to use a single SQL statement when supported

Rails 7 remove_columns will now trigger a single SQL statement to remove all columns if the database supports it, instead of querying multiple SQL statements for removing individual columns.

Rails 7 allows loading nested locales in the engine

Rails 7 allows loading nested locales inside the `/locales` directory by default for better organization in larger apps.

Rails 7 generators will raise errors if an attribute type is invalid

Rails 7 generators will validate the type by checking if it is of a default migration type and will raise an error if it is invalid.

Ruby 3.1 adds Enumerable#compact and Enumerator::Lazy#compact

Ruby 3.1 adds Enumerable#compact and Enumerator::Lazy#compact to return a copy of `self` with all `nil` elements removed.

Rails 7 adds maximum and minimum methods to Enumerable

Rails 7 adds `Enumerable#maximum` and `Enumerable#minimum` to calculate the maximum or minimum from extracted elements of an enumerable.