Hi, zzak here! お久しぶりです! This time I will be recapping the past month or so of Rails. Hang on! There’s a ton of stuff to catch up on!!
Originally extracted from HEY, this feature adds encrypted attributes to Active Record models. You can find out more in the guide.
Active Support’s cache has received a significant speed bump that was well overdue.
Optimize Active Model generated attribute methods
This optimization should reduce memory overhead and speed up boot times.
7x speed up for ActiveRecord::Base.logger
By converting AR::Base.logger to a class_attribute we had significant performance gains.
Allow nesting locales for Engines
This opens up better organization for larger apps using i18n.
e.g. config/locales/en/models.yml vs. config/locales/models.en.yml
Support Range objects in Active Job
This change adds an Active Job serializer for the Range object from Ruby.
Add Enumerable#sole to Active Support
Based on ActiveRecord::FinderMethods#sole, this method returns the sole item of the enumerable. If there are no items, or more than one item it will raise an exception.
Deprecate Enumerable#sum and Array#sum
Since Ruby 2.4 included these methods, Rails can start using the native versions for significant performance increase.
Improve Active Record performance for #one? and #many?
By limiting the generated count queries, this optimization provides significant performance increase for operations over many rows.
Log a warning when running SQLite in production
A warning is now emitted when trying to use SQLite in production, this can be disabled by setting config.active_record.sqlite3_production_warning to false.
Add disable_joins option to has_one relation
This solves a problem with has_one…through relationships whose tables are in separate database clusters.
Add support for require-trusted-types-for and trusted-types
This feature adds support for these two Content-Security-Policy headers which you can read more about over at MDN.
Remove and deprecate Rack::Runtime
Any apps depending on this middleware can still activate it manually, otherwise a deprecation warning will be sent and replaced with a fake.
Allow access to nested secrets in Rails.application.credentials
Now Rails.application.credentials.aws.access_key_id will return the same thing as Rails.application.credentials.aws[:access_key_id].
Add ActionController::Live#send_stream
Adds the ability to live stream binary data to the browser like send_data does for static files.
Extract ActiveStorage::Streaming
This allows you to stream blobs from cloud storage in any controller.
Add from: option to ActiveSupport::TestCase#assert_no_changes
This feature provides an optional keyword argument to assert_no_changes to specify the expected initial value.
61 people contributed to Rails this month. Check out the open issues to get involved and help out. Until next week!
This Week in Rails · 30 N Racine #200 · Chicago IL 60607 · USA
Unsubscribe | View in browser