Hi! Emmanuel Hayford with some cool updates for you.
Deprecated associations
You can now mark associations as deprecated using:
has_many :posts, deprecated: true
Active Record will report any usage of the deprecated association. Three reporting modes are supported: :warn (default)
, :raise
, and :notify
. You can also enable or disable backtraces (disabled by default).
Add locale options to PostgreSQL adapter DB create
PostgreSQL adapter create DB now supports locale_provider
and locale
.
Fix annotate
comments to propagate to update_all
/delete_all
This PR fixes annotate comments to work with update_all
and delete_all
.
Rails New: Only add browser restrictions when using importmap
When you generate a new Rails application right now, it will block older browsers. This behavior makes sense if you are using importmap-rails
, but if you for example use jsbundling-rails, it does not. This PR suggests only adding this blocker when you are using importmap, and not for all Rails applications.
Implement ActiveSupport::BacktraceCleaner#clean_locations
A new method ActiveSupport::BacktraceCleaner#clean_locations
allows cleaning an array of Thread::Backtrace::Location objects
:
clean_locations = backtrace_cleaner.clean_locations(caller_locations)
Filters and silencers still receive string representations, while the returned array retains the original path
attributes, since Location
objects are immutable.
You can view the whole list of changes here. We had 18 contributors to the Rails codebase this past week!
Until next time!
Subscribe to get these updates mailed to you.