Friday, March 22, 2024

Rails guides facelift, two new official gems and more!

Posted by vipulnsward

Hey everyone, Happy Weekend!
Vipul here with the latest updates for This Week in Rails. Let’s dive in.

Rails guides gets a facelift
Rails guides has a received a big design update!
Check out the Edge Guides to see these changes. If you find a bug or wish to submit a suggestion, you can open a discussion on GitHub.

Two new official gems
Solid Queue, a DB-based queuing backend for Active Job, has graduated to an official Rails gem.

Same for Mission Control — Jobs, which provides a Rails-based frontend to Active Job adapters. It currently supports Resque and Solid Queue.

Don’t enqueue jobs to process a preview image if no variant requires it
This PR fixes the issue where previewable attachments that don’t specify any variants, or no variants that require pre-processing, were still attempting to queue a job to process the preview image anyways.

Eliminate remaining uses of lease_connection inside Active Record
As part of moving towards adding a new config.active_record.permanent_connection_checkout setting, this change eliminates the remaining uses of lease_connection inside Active Record API.

Do not build View Watcher until the first updated? check
Currently initialization of every Rails::Engine leads to the creation of a new View watcher when the engine prepends its paths. This contributes to the time it takes to perform the first cold request on a lazy loaded application. This change delays the initialization of the View watcher until its first usage to only have one initialization of the watcher.

Allow primary_key: association option to be composite
Association’s primary_key can be composite when derived from associated class’s primary_key or query_constraints. Rails dint allow setting this explicitly even though it was already capable of supporting it.

This commit allows primary_key association option to be an array to support this behavior.

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

Until next time!

Subscribe to get these updates mailed to you.