Rails61

Rails 6.1 Adds rescue_from to ActionCable

The `rescue_from` on ActionCable::Connection::Base allows us to intercept unhandled exceptions

Rails Adds HTML Template Annotations

Rails 6.1 has added support for adding HTML comments to the rendered output indicating where each template begins and ends.

Rails 6.1 Adds if_not_exists for Indexes

Rails 6.1 adds if_not_exists option to add_index, propagating from create_table to indexes in the same block.

Rails Adds Descending Order to Batch Methods

Rails 6.1 adds order option to find_each, find_in_batches, and in_batches for ascending or descending processing.

Rails 6.1 Adds Enumerable#pick

Adding pick to enumerable will enable us to call pick on loaded relations, unloaded relations, and plain enumerables interchangeably.

Rails 6.1 Adds stream_or_reject_for

Rails 6.1 adds `ActionCable::Channel#stream_or_reject_for` to stream or reject connection based on presence of record

Rails Deprecates return/break in Transactions

Rails has disallowed using return, break and throw for exiting early from a transaction and having it committed.

Rails Adds :from/:to to previously_changed?

Rails Active Model Dirty method [attribute_name]_previously_changed? now accepts :from and :to arguments just like [attribute_name]_changed?

Rails Action Cable Adds Stream Unsubscribe

Rails adds ActionCable::Channel#stop_stream_from and ActionCable::Channel#stop_stream_for methods to allow user to unsubscribe from specific stream

Rails Adds Strict Loading to Prevent Lazy

Rails has added strict loading mode to prevent lazy loading of associations and help avoid N + 1 queries