Friday, June 14, 2024

New transaction event, bugfixes and more!

Posted by Greg

Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase.

Only sanitize content attribute when present in attachments
A recent security fix introduced sanitizing the content attribute of ActionText::Attachable::ContentAttachment. As a side effect it always sets the attribute, even when it’s missing, causing Trix to not show the image preview. This pull request fixes that issue.

Bring back puma.rb to target of app:update
Because Rails has improved puma.rb in the past a few times, rails app:update will update the file in the future releases.

Define the a start_transaction.active_record event
With this change, a new start_transaction.active_record event will be emitted when a transaction has been started. This event complements transaction.active_record, which is triggered when they finish.

Add filter option on in_order_of
This pull request adds a filter option to in_order_of in Active Record to prioritize certain values in the sorting without filtering the results by these values. The same change was done to Enumerable as well in 52072.

Add an internal route for bin/rails notes
This pull request adds an internal route rails/info/notes to display the same information you would get from running bin/rails notes so we can check the notes on UI.

You can view the whole list of changes here. We had 37 contributors to the Rails codebase this past week!

Until next time!

Subscribe to get these updates mailed to you.