This Week in Rails

Your weekly inside scoop of interesting commits, pull requests and more from Rails.
April 12, 2024

A week of fixes

Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase. Fix union select parentheses When building UNION or UNION ALL queries involving LIMIT or ORDER BY, Arel generated invalid SQL previously. This pull request changes Arel::Visitors::ToSql so that SELECT statements in Union and UnionAll nodes are enclosed in parenthes...
Read more
April 5, 2024

Defering jobs enqueuening to after the transaction commit, queries count in rendering logs and more

Hi, Wojtek here exploring this week’s changes. Rails World 2024 edition website is now live With tickets going on sale in April. Allow to register transaction callbacks outside of a record ActiveRecord::Base.transaction now yields an ActiveRecord::Transaction object, which allows to register callbacks on it. Article.transaction do |tra...
Read more
March 29, 2024

Retry known idempotent SELECT queries, New Active Record configuration option, and more!

Greetings! I'm Emmanuel Hayford, here to bring you your weekly instalment of "This Week In Rails". Let's dive straight into it. Two new guides are now open for community review. If you are well versed in Action View, partials, and helpers, please review and submit your feedback here: • Action View Overview PR • Action View Helpers PR A...
Read more
March 23, 2024

Rails guides facelift, two new official gems and more!

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. This also marks the b...
Read more
March 15, 2024

Active Record Basics Guide Refresh, Encrypted Attributes Re-Optimization, and more...

Hi, it’s zzak. Let’s explore this week’s changes in the Rails codebase. The Rails World CFP will close in just one week on March 21. Submit your talk in time! Active Record Basics Guide This PR refreshes the guide covering the basics of Active Record. Do not try to alias on key update when raw SQL is supplied A bug was found when updat...
Read more
March 8, 2024

Illustrator file preview, deprecations and more!

Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase. Feedback for structuring the Active Record Query Guide The Active Record Querying Guide is getting restructured and the team working on it requests feedback from the community. Rails World CFP closes in 2 weeks 2 more weeks left to submit your talk to Rails World 2...
Read more
March 1, 2024

Added fixture method and bugfixes

Hi, Wojtek from this side. Let’s explore this week’s few changes in the Rails codebase. Rails security update releases Rails Versions,, and have been released last week which contain fixes for security issues. Expose a generic “fixture” method in tests To avoid conflicting methods, in example with Minitest, it i...
Read more
February 24, 2024

Enhanced assert_broadcasts, file support for Logger outputs and more!

Hope you're having a lovely weekend. Emmanuel here with yet another batch of Rails updates for you! assert_broadcasts returns the messages that were broadcast assert_broadcasts now not only confirms the broadcast but also provides access to the messages that were broadcast. This enhancement, similar to what we have in assert_emails, fa...
Read more
February 16, 2024

Rails World CFP, ActiveRecord::Base.with_connection, devcontainer and puma-dev support and more!

Hi! Vipul here with the latest updates for This Week in Rails! Rails World CFP Call for Papers is now open for The Rails World 2024 conference that will be held in Toronto, Canada this year. The CFP will remain open until 21st March. Head over here to submit your proposal! Generate devcontainer files by default This change generates a ...
Read more
February 9, 2024

Rails Foundation Docs, Query Logs source_location, Dockerfile gets jemalloc

Hi, it’s zzak. Let’s explore this week’s changes in the Rails codebase. Rails Foundation Docs A team has been formed to improve the existing Rails documentation. PRs from this project will stay open for one week for community review. Open this week: • ActiveJob.perform_all_later • Action Text • Action Mailbox More to come! Properly syn...
Read more
February 2, 2024

Deprecation, bugfixes and more!

Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase. Deprecate passing nil as model argument Passing model: nil as an argument to the form_with method will be deprecated in the next release of Rails. Skip CSS when creating APIs This pull request makes the Rails generator skip the CSS part if the --api flag is set, be...
Read more
January 26, 2024

Customized console prompt and bugfixes

Hi, Wojtek from this side with a short set of changes in the Rails codebase. Add customized prompt for Rails console Rails console now indicates the current Rails environment with the name and color (red for production). Fix rotation detection for HDR videos This fix removes the positional reference on side_data and explicitly searches...
Read more
January 19, 2024

A class method to introspect delegated types, schema_dump configuration via DATABASE_URL, etc

As the morning sun casts its gentle glow, I find myself aboard a train bound for Szklarska Poręba. I'm literally on Rails! I thought, what better setting to share the latest updates on Rails than while traversing these literal rails? Define a class method to introspect valid delegatable types This PR introduces a <role>_types class met...
Read more
January 12, 2024

Updated Puma configuration, Object#with_block, and more!

Hi! Vipul here with the second edition of This Week in Rails for 2024! This second week continues with a flurry of activity with more than 140+ changes making in. Lets dive into some of these changes! Update the default Puma configuration There was an extensive discussion in this issue about - setting a new default for the Puma thread ...
Read more
January 5, 2024

Omakase RuboCop, Brakeman, Ruby 3.1+, allow_browser, rate_limit, and more

Hi, zzak here with the first edition of This Week in Rails for 2024. This year started off with a ton of contributions, nearly 170 commits, sorry we couldn’t fit everything in a single newsletter. Rails UJS has been deprecated since Rails 7, time to die While the official package "@rails/ujs" is still published on NPM, and the final co...
Read more
December 29, 2023

This year in Rails, a summary of 2023

This is Emmanuel, Greg, Vipul, Wojciech, and Zzak, bringing you the summary of what happened with Rails in the past year. It was a busy year with over 4300 commits from 520 contributors and 23 releases, including Rails 7.1! For this year end issue, as a team we each hand-picked some of our favorite pull requests from the last year. Ref...
Read more
December 22, 2023

This Week in Rails: bug report template changes, new test helpers and more!

Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase. Rails World 2024 updates The venue, the sponsorship options, information about the CFP and the ticket costs were announced this week. Fix inclusion of url_helpers module in concern The dynamically generated url_helpers module is an ActiveSupport::Concern. Therefore...
Read more
December 15, 2023

Exposed queries assertion methods and more

Hi, it’s Wojtek with latest changes in the Rails codebase. Expose queries test assertion methods To assert the expected number of queries are made, Rails internally uses assert_queries and assert_no_queries. These assertions can now be used in applications as well. Allow serving compressed SVG images This adds image/svg+xml to the comp...
Read more
December 8, 2023

Allow object_id as a column name for Active Record and a lot more!

Take Active Record affixes into account for Active Storage database models This pull request ensures that all Active Storage database-related models adhere to the ActiveRecord::Base.table_name_prefix configuration. Make isolated engines aware of Active Record::Base table name prefix Address isolated engines to incorporate the ActiveRec...
Read more
November 24, 2023

ErrorReporter#unexpected, with_routing test helpers and more!

Happy Thanksgiving weekend everyone! This is Vipul bringing you the latest from this week’s changes in the Rails codebase. ErrorReporter#unexpected to report in production but raise in development This change adds ErrorReported#unexpected to report precondition violations. For example: def edit if published? Rails.error.unexpected("[BU...
Read more
November 17, 2023

Action Mailer bug report template, Active Storage fixes and more!

Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase. Fix word_wrap with empty string This pull request fixes word_wrap to return an empty string instead of nil when given an empty string. Process preview variant when processing preview This pull request updates ActiveStorage::Preview#processed to generate both the fu...
Read more
November 10, 2023

YJIT enabled by default, Active Model improvements and much more

Hi, it’s Wojtek. This week, the documentary movie about the origins of Ruby on Rails premiered. You can see it on the Honeypot YouTube channel. Now, let’s explore this week’s changes in the Rails codebase. Enable YJIT by default if running Ruby 3.3+ There was many public reports of 15-25% latency improvements for Rails apps that did en...
Read more
November 3, 2023

"INSERT...RETURNING" for MariaDB, "SET CONSTRAINTS" for PostgreSQL, "DEFERRABLE" foreign keys for SQLite and much more!

Hey, zzak here with the first edition of This Week in Rails for November, 2023. Support RETURNING clause for MariaDB This PR adds support for the INSERT ... RETURNING expression for the MariaDB adapter. You can read more about this feature in the official MariaDB docs. Simplify attr_internal_define This PR optimizes the internals of Mo...
Read more
October 28, 2023

Reduce memory used by ActiveSupport::Callbacks, non-column-backed attributes for enum and more!

Hi! This is Vipul bringing you the latest from this week’s changes in the Rails codebase. Reduce memory used by ActiveSupport::Callbacks Previously, callbacks which were shared with subclasses would not share between them the procs generated in before/after filters. This was also lazily generated so would cause memory growth after an a...
Read more
October 20, 2023

Rails World talks online, fix of a 13 years old bug and more!

Hi, it’s Greg, bringing you this week’s changes in the Rails codebase. Rails World talks are online The talks from Rails World 2023 are now available to watch online! You can watch all of them on the YouTube playlist. Also, Amanda Perino wrote a recap of Rails World. Do not memoize auto/eager load paths in engines This pull request fix...
Read more
October 13, 2023

Special Rails World Edition: Rails 7.1.1, Solid Queue, Solid Cache, Turbo 8, etc.

Rails World concluded last week, and calling it a success would be an understatement. With 29 exceptional speakers and a diverse audience of over 700 attendees representing various corners of the globe, Rails Foundation, under the leadership of Executive Director Amanda Perino, executed an inaugural Rails conference that exuded the mat...
Read more
September 29, 2023

This Week in Rails - September 29

Hi, Wojtek here. The Rails World starts next week. Three members of the current This Week In Rails editorial team — Greg, Emmanuel, and myself — will be in attendance. We’ve got some stickers featuring the newsletter’s logo, so be sure to spot us to snag one! Now, let’s delve into the latest updates in the Rails codebase. Rails 7.1.0.r...
Read more
September 22, 2023

SQLite3 adapter now handles default functions with concatenation and supports `supports_insert_returning?`

Default retry strategy uses polynomial backoff instead of exponential backoff This modifies the wait option's name to provide a more explicit indication that jobs will undergo retry attempts using polynomial backoff. It also ensures that the previous, legacy name remains functional to maintain backward compatibility. SQLite3 adapter ha...
Read more
September 15, 2023

This Week in Rails: 7.1 beta release, Bun support and more!

Hi, it’s Greg, bringing you the latest changes in the Rails codebase. Rails 7.1 beta release The first beta version of Rails 7.1 has been released! There have been over five thousand commits made by over 800 contributors since Rails 7.0, so this release is packed with new features and improvements. You can read a summary of the changes...
Read more
September 9, 2023

Infer primary_key: :id on associations with composite primary key models, add validation option for enum and more!

Hi! This is Vipul bringing you the latest from this week’s changes in the Rails codebase. Infer primary_key: :id on associations with composite primary key models Prior to this change, you’d need to do the following to set up associations for composite primary key models: class Order self.primary_key = [:shop_id, :id] has_many :order_a...
Read more

See more posts »