This Week in Rails

October 31, 2021

🎃 Halloween Edition: Zeitwerk migration guide, selenium-webdriver, and some Ruby 3.1 snacks

🍭 Trick or treat, zzak here after a week off with lots of goodies! 🍬

This new guide has all you need to know to switch the autoloader for Rails 6.x and 7.0 applications!

This new method prohibits swapping shards within the given block. This can be useful if you're using sharding to provide database isolation on a per-request basis.

This PR adds the ability to specify the path used for schema dump files. For those using horizontal sharding, previously a schema file would be created for every shard which makes sharing the same migrations across shards more difficult.

Previously, Rails generated a Gemfile with an alpha release for selenium-webdriver due to an incompatibility with Ruby 3.0

Since all modern Rubies support this interface a small optimization can be made to reduce method calls in Active Record connection adapters.

When running your Rails app test suite inside of a CI environment that sets ENV["CI"] it's recommended to turn on eager loading to help identify errors that may only occur in production. This will be the default for newly generated apps.

You can now effectively use an RFC 4122 compliant string by default in newly generated apps, or by enabling the new `config.active_support.use_rfc4122_namespaced_uuids` setting.

With the addition of Class#decendents in Ruby 3.1, we can avoid iterating over every object in ObjectSpace to achieve the same feature. Also, check out #43548 for some additional refactoring of DescendantsTracker.

`Rails.application.executor` hooks are now called around every tests which helps prevent state to leak from one test to another.

Similar to :year_format, this new option for date_select allows you to pass a lambda for setting the format to display days select options.

38 people contributed to Rails since the last time. All the changes can be checked here. Until next week!

About This Week in Rails

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