Hi, it’s Greg, bringing you the latest updates about Rails.
Updated guides await community input
The Asset Pipeline, Layouts & Rendering, Caching, and Active Job Basics Guides
have all recently been updated and are open for community input. If you have
time and would like to help review, please check the list of pull requests.
Apply for the Rails at Scale Summit
Reminder to apply by May 8 for the Rails at Scale Summit (Sept 22, Austin), a
one day, invite-only gathering for engineers working on large-scale Rails
applications.
Enable frozen string literal by default
New Rails apps now include a config/bootsnap.rb file that enables frozen string
literals. This only impacts the application code, not the dependencies.
It is also possible to enable it for dependencies to reduce allocations, but some older gems may not yet be compatible. If you do attempt this an run into incompatibilites please do report it on the gem’s bug tracker.
Additionally, .rubocop.yml is configured to assume frozen string literals
are enabled, if you decide not to enable frozen string literals for your application,
make sure to update the rubocop configuration accordingly.
Fix find_signed for models with a composite primary key
ActiveRecord::SignedId::ClassMethods#find_signed raises an ArgumentError
for any model that declares a composite primary key (e.g. self.primary_key =
[:shop_id, :id]). The bang variant find_signed! works correctly and this
pull request makes find_signed consistent with find_signed! and find.
Allow using aliases for unions in from clause
This pull request fixes the issue of #from acceptings unions, but silently
ignoring passed aliases. For instance a query like this: SomeModel.from(union,
:some_models), produced an error missing FROM-clause entry for table
"some_models" in PostgreSQL before this fix.
You can view the whole list of changes here.
We had 11 contributors to the Rails codebase this past week!
Until next time!
Subscribe to get these updates mailed to you.