This Week in Rails

Your weekly inside scoop of interesting commits, pull requests and more from Rails.
February 10, 2023

Parameter filtering and an improved ActionView::Helpers::TagHelper#token_list

Përshëndetje! Emmanuel here with the usual stuff. filtered_path in ActionController::Instrumentation event payloads over fullpath For security reasons, some data need to be filtered before it reaches bad actors. Rails now filters parameters in paths that may include sensitive information in logs. Instead of passing fullpath to ActionCo...
Read more
February 3, 2023

Week 05: Spring is here?

Hi, it’s zzak, happy 節分! I’m very excited for spring, this winter has been tough! Let’s get into this week’s changes in the Rails codebase. Use infinitive form for all task descriptions verbs All the common rails commands and some extended commands use the infinitive form for the verb in the description: “Generate …”, “Start …”, “Run …...
Read more
January 27, 2023

New AssumeSSL middleware, raise on missing translations everywhere, and more

Hi, it's Wojtek. Let's explore this week's changes in the Rails codebase. Rails 7.0.4.2 and 6.1.7.2 have been released Released 7.0.4.2 and 6.1.7.2 versions addressing a compatibility issue with the 7.0.4.1 and 6.1.7.1 security releases from last week. Allow use of SSL-terminating reserve proxy that doesn't set headers Add ActionDispat...
Read more
January 20, 2023

Active Record regroup, CurrentAttributes name restrictions and more!

Hola, this is Greg, bringing you the latest changes from Rails. Raise exception when if a restricted attribute name is used with CurrentAttributes Attribute names like set and reset should not be used with ActiveSupport::CurrentAttributes, because they clash with its public API. With this change, an ArgumentError is raised when a restr...
Read more
January 13, 2023

An endpoint for uptime monitors, an improved help command, etc

Halløj. It's me again, bringing you the usual goodies from Rails. Show relevant commands when calling help This pull request improves the user experience by displaying the appropriate commands for the context in which the user is running rails -h or rails. When outside of a Rails application, the output will be the options for the rail...
Read more
January 6, 2023

First edition of 2023! 🥂

Long time no see! 新年明けましておめでとうございます!Zzak here to bring you the first This Week in Rails of.. *almost writes 2022*. 🤣 Spotlight I want to try something different, there has been one particular person that I feel deserves a Shout Out: Akira Matsuda. He has contributed 40 commits since the last episode..! His focus has been on incremental...
Read more
December 30, 2022

This Year in Rails, a summary of 2022!

Hey! This is Emmanuel, Greg and Wojciech, bringing you the summary of what happened with Rails in the past year. It was a busy year with 3131 commits from 491 contributors and 31 releases! We carefully selected the most significant pull requests for inclusion, but it is possible that we may have overlooked some due to the need to keep ...
Read more
December 23, 2022

Rails on Docker, local? environment inquirer and more!

Hi there, this is Greg, bringing you the latest changes in Rails! Only include all_queries default scopes on reload This pull request changes the current behaviour on reload, which applies all the default scopes, if any are marked as all_queries: true. The correct behaviour is to only apply all_queries: true default scopes on reload. A...
Read more
December 16, 2022

Documentation on preloading STIs, TimeHelpers improvement, etc

नमस्ते, This is Emmanuel Hayford with some updates from Rails! Hide changes to before_committed! behaviour behind config This PR introduces a new configuration option that will enable before_committed! callbacks on all enrolled records in a transaction by default in Rails 7.1. Previously, callbacks were only run on the first copy of a ...
Read more
December 9, 2022

Disabled IRB autocompletion, bugfixes and more!

Hi, this is Greg, bringing you the latest news about Rails. Replace method_source gem with Ripper With this change, Ripper is used to determine the last line number of a given test method to support running tests by line number. Disable Rails console IRB's autocompletion in production by default Autocompletion increases data transmissi...
Read more
December 2, 2022

Executive Director for Rails Foundation needed, Stimulus 3.2 and more

Hi, Wojtek here with this week's news from the Rails world. The Rails Foundation is hiring an Executive Director The Rails Foundation is looking for a full-time executive director to run day-to-day operations, and implement the Rails Core Team's mission to improve the documentation, education, marketing, and events in the Rails ecosyst...
Read more
November 25, 2022

Disable enum methods generation, a concurrency fix and more!

Hi there, This is Greg, bringing you the latest changes in Rails. Make sure that concurrent map usage is thread-safe This pull request changes the way a cache miss is handled. It makes it thread-safe and ensures that it's not overwritten in the middle of execution. Autoload ActiveModel::ValidationError This pull request adds the missin...
Read more
November 18, 2022

The Rails Foundation, Stimulus Outlets API, bug fixes and lots of improvements!

Boa noite! This is Emmanuel, bearer of good tidings. Introducing: The Rails Foundation In case you missed it, with eight founding members, Rails has started The Rails Foundation! Together, the founding members have contributed a total sum of $1,000,000 that will aid the foundation's mission to improve the documentation, education, mark...
Read more
November 11, 2022

This Week in Rails: A bugfix and improvements!

Hi there, This is Greg, bringing you the latest changes in Rails. Fix Enumerable#many? to handle all block parameters Before this fix, Enumerable#many? didn't forward the block parameters to the block, so if someone called it in a chain with each_with_index, the index wasn't passed to the block. Use filename when printing pending migra...
Read more
November 4, 2022

An improved error page, groundwork for composite primary keys and Stimulus 3.1.1

Hi, Petrik here with this week's news from the Rails world. Improve the "missing template" error page This error page got a nice overhaul with clearer wording, making it more helpful, especially for beginners. Allow specifying columns to use in ActiveRecord::Base object queries Support for composite primary keys in Rails is getting pri...
Read more
October 28, 2022

More intuitive checking of form check boxes and radio buttons

Hi, Wojtek here with this week's news from the Rails world. Support checked as a keyword argument in check_box_tag and radio_button_tag Now the form helper f.check_box "admin", checked: falseworks as expected. Previously it had to be passed as positional argument. Allow Active Record adapter "execute" to retry on connection-related exc...
Read more
October 21, 2022

An Active Record improvement, performance gains and a bugfix!

Guten Tag! Emmanuel here again, with some updates from Rails. Don't trigger after_commit :destroy callback again on destroy if record previously was destroyed The after_commit :destroy callback would always run even if a record was destroyed previously. This PR fixes that. Essentially, we don't want to call after_commit :destroy on unp...
Read more
October 14, 2022

Column information in ERB template exceptions, migration option validation and more!

Hey, this is Greg bringing you the latest news from the Rails world. Add column information to exceptions inside ERB templates This PR adds column information to exceptions that occured inside ERB templates. There are before and after screenshots of the Rails error page, and a great explanation of the change in the PR description. Vali...
Read more
October 8, 2022

Updated Permissions-Policy directives and LSP support?

Hi, this is Petrik with this weeks updates in the Rails world. Support more Permissions-Policy directives With the Permissions-Policy header you can allow or block the use of browser features. This pull request adds support for directives for the following features: hid, idle-detection, screen-wake-lock, serial, sync-xhr and web-share....
Read more
September 30, 2022

ERB in YAML keys, performance boosts, a new option for QueryLogs!

こんにちは。I'm Emmanuel, and I've got some updates for you! Avoid double type cast when serialising attributes ActiveModel::Attribute#value already casts model attributes when persisting models, however some model attribute types try to cast a given value before serialising it. This means casting is done twice in most cases. This PR fixes t...
Read more
September 23, 2022

Improved assert_redirected_to, improved error messages and more!

Hi, this is Greg, bringing you the latest changes in the Rails framework. Allow specifying the HTTP status code in assert_redirected_to Before this change, assert_redirect_to asserted any 3XX response, but with this change, it is possible to assert a specific response code, like 301. Allow passing classes to dom_id Allowing dom_id to r...
Read more
September 17, 2022

Handling reconnects in Action Cable, no more Coffeescript and a new guide.

Hi, this is Petrik with this week's Rails updates and some Hotwire news. Add exclude? method to ActionController::Parameters exclude? returns true if the given key is not present in the parameters. It is the inverse of include?. Adding this method keeps things a little more consistent with a Hash. params = ActionController::Parameters....
Read more
September 10, 2022

Rack 3 and Rails 7.0.4, 6.1.7, and 6.0.6 releases, ActionDispatch::Cookies, etc

👋🏾... This is Emmanuel. I've got some Rails updates for you. Rack 3.0 has shipped A major version of Rack has shipped, and as expected, there are breaking changes but with lots of improvements and an upgrade guide. There's also a changelog of the beta versions and release candidates leading up to the release. Rails 7.0.4, 6.1.7, and 6....
Read more
September 2, 2022

Bugfixes, improvements and more!

Hi, this is Greg with the latest news from the world of Rails. Return "Range Not Satisfiable" return code for partial downloads with incorrect range This PR fixes an issue when a partial download request with an incorrect range was made. Before the fix, Rails threw a RoutingError, but from now on it returns a "Range Not Satisfiable" re...
Read more
August 26, 2022

Finer-grained error pages and extended routes grepping

Hi, this is Petrik with more Rails updates. Use the error_highlight gem to locate the columns where an error was raised Ruby 3.1 added the error_highlight gem to display the fine-grained location of where an error occurred. Rails will now use error_highlight on error pages to show the column range of where an error occurred. Extend bin...
Read more
August 19, 2022

Logging, raising and rescuing errors and a fix for a query method.

Cześć! I'm Emmanuel, and I have some updates for you from Rails. Log a warning if ActiveSupport::Cache is given an expiration in the past Imagine trying to write/fetch to/from a cache and the operation fails silently because `expires_at` is in the past... a debugger's nightmare. This PR helps. You won't get an error raised, instead, yo...
Read more
August 12, 2022

Bugfixes, improvements and more!

Hola, this is Greg bringing you the latest news from the Rails world! Improve failure safety for RedisCacheStore#delete_multi This PR fixes the issue when Redis is down and Rails.cache.delete_multi is called. With this change this will be gracefully handled rather than raising an exception. Ensure drop_enum is always reversible The rec...
Read more
August 5, 2022

Strict template locals, detecting unused routes and an improved find_or_create_by

Hi, Petrik here with some updates on activities in Rails and associated projects over the last week. Allow templates to set strict locals By default, templates will accept any locals as keyword arguments. To define what locals a template accepts, add a locals magic comment: <%# locals: (message:) -%> <%= message %> Try to find a second...
Read more
July 29, 2022

Cache invalidation via ActiveStorage::Blob, Conditionally executing has_secure_password, etc

Maadwo! Emmanuel with some updates on activities in Rails over the last week. Allow passing Hash on secure password validations You can now pass an option hash to has_secure_password. If the option evaluates to true, then has_secure_password executes along with validations, otherwise it doesn't. Touch model records after ActiveStorage:...
Read more
July 22, 2022

Bugfixes, performance improvements and more!

Hi, this is Greg, bringing you the latest news from the Rails world. Fix caching of missed translations Using Object.new for the default value of a missing translation caused the cache store to return a different object when being fetched from the cache. This PR changes the default to an integer, which resolves the problem. Add endless...
Read more

See more posts »