This Week in Rails

October 28, 2022

More intuitive checking of form check boxes and radio buttons

Hi, Wojtek here with this week's news from the Rails world.

f.check_box "admin", checked: false
works as expected. Previously it had to be passed as positional argument.

Allow Active Record adapter "execute" to retry on connection-related exception

Setting allow_retry to true causes the database to reconnect and retry executing the SQL statement in case of a connection-related exception. Should only be used for known idempotent queries.

Expose the "request.parameter_filter"
Feature is useful when one wants to filter some hashes based on the same parameter filter as the request:
request.parameter_filter.filter("secret" => "foo", "something" => "bar"))
#=> { "secret" => "[FILTERED]", "something" => "bar" }

Adds "validate" to foreign keys and check constraints in database schema file
Previously, schema.rb would not record if validate: false had been used when adding a foreign key or check
constraint, so restoring a database from the schema could result in foreign keys or check constraints being
incorrectly validated.

Fix "MemoryStore" to preserve entries TTL when incrementing or decrementing
The change is to be consistent with how MemCachedStore and RedisCacheStore behaves, ie don't remove the expiration value.

There were 23 contributors to Rails this week. You can browse all the changes here.
Until next time.