Rails
Rails 7 only_numeric Validator Option
With Rails 7, only_numeric option can be used for the numericality validator.Rails in_order_of Drops Unlisted Records
QueryMethods#in_order_of now filters down to only the values provided, matching the behavior of the eponymous Enumerable method.ActiveRecord find Reuses find_by Cache
ActiveRecord::Core now prevents duplicate entries in find/find_by cache resulting in slightly improved performance.Rails 7 Raises UnsafeRedirectError
Now unsafe redirects raise a UnsafeRedirectError instead of an ArgumentError.Rails 7 Nested Attributes for delegated_type
With Rails 7, accepts_nested_attributes_for can be used for delegated_typeRails 7 Auto inverse_of Detection
This update ensures that "inverse_of" takes into consideration the relevant scope when calculating the object to store in memory.Rails 7 Adds update_attribute! Method
While update_attribute was used to bypass validations, update_attribute! now does the same but raises ActiveRecord::RecordNotSaved in case of any errorsRails 7 PostgreSQL Generated Columns
Rails 7 now adds support for generated (virtual) columns to the PostgreSQL adapter that has been available since PSQL v12.Rails 7 Plain Text for Nested Fields
Plain text rendering of nested fields now reserves indentation.Rails 7 Timestamps in insert_all
All relevant timestamp columns (`created_at`, `created_on`, `updated_at`, `updated_on`) are now set via ActiveRecord when using mass insertion queries.