Active record improvements and much more

Posted by morgoth85, July 23, 2021 @ 12:00 am in News

Hi, Wojtek here presenting quite a lot of changes from the past week.

Disable schema dump per database

Dumping the schema is on by default for all databases in an application. To turn it off for a specific database one can now set schema_dump: false in the database config file.

Add change tracking methods for belongs_to associations

Two new methods were added: association_changed? and association_previously_changed? (assuming an association named :association) to Active Record.

Raise error on unpermitted open redirects

Add allow_other_host options to redirect_to. One can opt in to this behaviour with ActionController::Base.raise_on_open_redirects = true.

Update Capybara drivers

Deprecate poltergeist and webkit (capybara-webkit) driver registration for system testing (they will be removed in Rails 7.1) and add cuprite instead.

Fix dirty check for Float::NaN and BigDecimal::NaN

Float::NaN and BigDecimal::NaN in Ruby are special values and can’t be compared with == method.

Make ActiveModel::Errors#inspect slimmer for readability

It will now only output the errors inspection omitting the base object.

Add Middleware#remove

It will raise an error if the middleware is not found.

24 people contributed to Rails since last time. All the changes can be checked here. Until next week!