Rails 6.1.3 has been released

Hi everyone,

I am happy to announce that Rails 6.1.3 has been released.

CHANGES since 6.1.2

To view the changes for each gem, please read the changelogs on GitHub:

To see a summary of changes, please read the release on GitHub:

6.1.3 CHANGELOG

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-256 hashes.

Here are the checksums for 6.1.3:

$ shasum -a 256 *-6.1.3.gem
3bc59df7dfa5bebda5fb50dd52df7f8bac824bbcb209353b9d3bd0fa000debb1  actioncable-6.1.3.gem
b7291919c0b89c4c1aef58fe8dd265f94332929d4ff938919cc011db89b86273  actionmailbox-6.1.3.gem
49ad423587cde9032ae01ca209ea52cda6b689a192e27663ba23626e58252c52  actionmailer-6.1.3.gem
05ef482bcaa6390de3518468aaa199c4c13c32e7eba7462e2b2cd23fb5f21e0c  actionpack-6.1.3.gem
0f436e5d135f5c1324d534cf66961482593051343575d0dffa4b03223bf96412  actiontext-6.1.3.gem
857fa724c5470f79e245978b13feba877e41d8bb367c4aca0b2d9eb85460b3e8  actionview-6.1.3.gem
aed2cbf9396239f2766e75cd72e47ad361b7ed4f1ce0ad65d7b441a60046ad9c  activejob-6.1.3.gem
e02c3751e0768bf4732d2ca9595628fc5edcb2e429ff625eff2d3406402ea81e  activemodel-6.1.3.gem
7ac74827f02bbd01be23cae93b8fcb22e77b2e9557b62813e231354ef536790e  activerecord-6.1.3.gem
91342af6501c5d37a8d401c99520c69da1ff27086b7c1f6f6ff5235ee2da7d3e  activestorage-6.1.3.gem
1009ad0f8a8bd3f752b59b25f60bf4dbb59ab115537d68a6f785a347cc6a4401  activesupport-6.1.3.gem
7f097f7c565c7ce6c9a0c07345c3af61f9776d65b9bee2fda72718a53db3aa41  rails-6.1.3.gem
2a133eeb9b2b19530ce049716268ae74c508e7cd7b0489c602983dc75af10599  railties-6.1.3.gem

As always, huge thanks to the many contributors who helped with this release.

Rails 5.2.4.5, 6.0.3.5 and 6.1.2.1 have been released

Hey everyone! Rails version 5.2.4.5, 6.0.3.5 and 6.1.2.1 have been released! Those version are security releases and addresses two issues:

Here are the checksums for the gems:

$ shasum -a 256 *-5.2.4.5.gem
729c0ef823966a42519924c9f663f8cc81264a75b022777fab32087352299de6  actioncable-5.2.4.5.gem
d73f50d0d32feba6e4170d1c03d877ce72c422d5beb2aad39853e1eb9bf0c5a7  actionmailer-5.2.4.5.gem
182e5328ab1dd9c7f60a473dac01c31dabbe04755019033449d1c16ce91c08b6  actionpack-5.2.4.5.gem
2c2129183e1999a8a8a47ad1125c129e6ee5ad76fa9500cc1f034251da4bae4f  actionview-5.2.4.5.gem
cacf79caf005bbec89a30a4af6494395b2bf281ddf1cb5ee78bee7b513d164d5  activejob-5.2.4.5.gem
f5fcbe15f3bf4390dbc7eb1e2c6a69aa793026a6149e29fec534cb69bb5c8461  activemodel-5.2.4.5.gem
cfc9e2831fac5068b6dbbcf98129a8ba3491ab214d48d7bc5e229faf4232afea  activerecord-5.2.4.5.gem
010152f9f09a9e654f38e1d7092fbb122d6ded58205692b7c40ebcbe8755238a  activestorage-5.2.4.5.gem
8c25759e6c5df1de673e9bfc35e42f4c5e021d47a8dde103a00f17f1467ee43a  activesupport-5.2.4.5.gem
cd4dd4b224e58a8bc03c3fb182fd748dda2f36abfae6ecd8db145a8c5da8fadb  rails-5.2.4.5.gem
cde5e0326b7f600ac4bed5e1c5fd0a57074ec4c98981e1173f98d4f91d978fe3  railties-5.2.4.5.gem
$ shasum -a 256 *-6.0.3.5.gem
57da7287cfca8f35007dd7ff317d01dbc862725b1a1799ed150be1d985682455  actioncable-6.0.3.5.gem
8ce0f2b94da995234df28a7cedd9551a6e9fc07b6d066c4a9a4a99e7744570ec  actionmailbox-6.0.3.5.gem
1b187024f960bda2d9d3261e1feb66dd1c38d38f30a7c32a5c8529c0c45d1663  actionmailer-6.0.3.5.gem
7680d8eaa6d62c095c2fc0b5dee6ac847248fa6ffe8de0c5cd3fc86444463683  actionpack-6.0.3.5.gem
3617c8fb6ebb4d6b5277971910c2ce66dba54d23e9ee3de6b8afdbb5b0010711  actiontext-6.0.3.5.gem
3b1c114de883190347b7f693025d627a3091dbc6c33ed9367a985812c6c5241b  actionview-6.0.3.5.gem
a50feb20997dd16901e15303ff0a7ec598c31918487a967a913107a0f1d24695  activejob-6.0.3.5.gem
7018b906bc9131180f19009e66e12329573589f62e3c5cab6a7b6032d5e8db07  activemodel-6.0.3.5.gem
684fb6b075c774a193f2253b6373df7b9f96b9d8a199c3f606fe04849c242d9f  activerecord-6.0.3.5.gem
4a28c519951fb768b9306baf11a31872217449b5b2da2e51d69812daaac0ce1f  activestorage-6.0.3.5.gem
74714fcffa24cda6bef4c66b84207a8ea037c2c1d34cc06c02816187df5d7f55  activesupport-6.0.3.5.gem
0a914868970c2f8cf3ca5e6e331337d630d8994a4bdbe62a919258fcb274fb05  rails-6.0.3.5.gem
273f83c9db727a652fb7921dd3e9fc62de7051faf8c7e9412f10a17661ec2a1d  railties-6.0.3.5.gem
$ shasum -a 256 *-6.1.2.1.gem
4267ad208cb8465879757d1f96e680325d803c8b73b9766bfb5cd598f35cb2a2  actioncable-6.1.2.1.gem
64485af94d4401b0f9db22316011eab5f5dbf85c914d209d91267ddc041824b9  actionmailbox-6.1.2.1.gem
e592f49d31ac3435a091997858b8acec13ef54d9dcc8167f7ba25fae327ab8db  actionmailer-6.1.2.1.gem
c25cb7dfe362a4d9c92e9a746810a6a9bf4db5c864785b681319b59e4c860ff3  actionpack-6.1.2.1.gem
c04664f9b6b52a0b8dd32dfac08290601b1ddf8a06e926ec0f57a5f9fb38bf26  actiontext-6.1.2.1.gem
93df05374f79cf3d23778c5131babed120b51dcceb2ec79e3efb55a09aed955d  actionview-6.1.2.1.gem
325373503de3ebd2a44d699fc0079d3e2909fb6549145066ad682906e9389023  activejob-6.1.2.1.gem
d19e1931217ed00fafe69fe98d9ee92d385f6a92ac7200a844a5f9b4c548a4ee  activemodel-6.1.2.1.gem
cab04eb203c17429dab1ddcaf8357865eb5e41dceb7ad1fdef69f815870934fa  activerecord-6.1.2.1.gem
5d4f2b696947d141ca98a132d94fc82115ed707c535c13a57db1e9c6e344ab13  activestorage-6.1.2.1.gem
7155b715636faa2970123501f2356d3dc7390dcd9f2f9cb455f91e5d5b4ee250  activesupport-6.1.2.1.gem
32409615eb41eb7719a82715c6d167757f18d9080a6ba7fa7fcf6e1b59f52112  rails-6.1.2.1.gem
fd8a3cd6753230bf51601aa308f04909033870fe3fc8fb0a3e6fb8dde2133ce1  railties-6.1.2.1.gem

Have a great day!

<3

Rails 6.1.2 has been released!

Hi everyone,

I am happy to announce that Rails 6.1.2 has been released.

CHANGES since 6.1.1

To view the changes for each gem, please read the changelogs on GitHub:

To see a summary of changes, please read the release on GitHub:

6.1.2 CHANGELOG

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-256 hashes.

Here are the checksums for 6.1.2:

$ shasum -a 256 *-6.1.2.gem
fd12348ec00f26b2f247e23cbe73804755c90236d9aebcbc136fc149ebee0901  actioncable-6.1.2.gem
3fd0400d1277c711e085162c5a35caa15dd98f84fefc4a0773dc336a1fef65e0  actionmailbox-6.1.2.gem
98118a814826715a9f88cc0ff07a517a229d21ce08e53ed5024e0af889292689  actionmailer-6.1.2.gem
16d09ebb77253a30abe7eb4fd554d17706418f639c61da9a14903ddbf72976ae  actionpack-6.1.2.gem
0b7dc18051a91b995298971e3871a8e20be088a2a2831e484bacfeeebcf6cb77  actiontext-6.1.2.gem
7c72aeae52d42ce3757a5ae4ef68b0e8ece09ce26baea071ed4fa80cae1a0406  actionview-6.1.2.gem
f297e27c0c2d5363e7b574806939944e3656a34eb32b5b43a28a059e9c4a6ca3  activejob-6.1.2.gem
58fd5b3b68ca2a54c6ba7801936e9cb6b1ce50c6154f894dbaf6275cb8778c4b  activemodel-6.1.2.gem
8e8fdeb864b02a7a360d78bc97f5064a53bcacbc812c8ae4e9ea5cf6d1e28f1e  activerecord-6.1.2.gem
fd19ac42caf2a8a654027eb510092cdf8d43384e352dc397246aac9bccf62469  activestorage-6.1.2.gem
098f2cc82f7232364ad9493155d3a34f44baecb5b51ce6646a015396a6d525a8  activesupport-6.1.2.gem
e62c90c4a62f0d177161e0df05d7ba417010858fa418affdb2d93981e407a04e  rails-6.1.2.gem
753527d97b2f68db999417a30d274b62317e082a7f96f88e7e1b10c846ad6d21  railties-6.1.2.gem

As always, huge thanks to the many contributors who helped with this release.

Defaults to "main" branch name, new webpacker guide and improved strict loading

Hi, Wojtek here with the summary of changes from the last days.

Renamed master branch to main in the Rails repository

As mentioned by DHH and performed by Rafael França the default branch for most of the Rails git repositories is now called “main”.

Webpacker added to edge guides

The detailed guide how to use webpack build system with Rails via webpacker gem. You can read it on edge guides.

Opting out of strict loading on a per-record base

This is useful when strict loading is enabled application wide or on the model level.

Improved strict loading violation error message

This change updates the error message to include both the class and the association name which makes it clear what exactly failed.

39 people contributed to Rails since last time. Check out the open issues to get involved and help out. Until next week!

Hello 2021: Sole record, Same form multiple verbs, Validator with range, Rich text control

Hi there. Andy here, with the first newsletter of 2021, highlighting some updates to Ruby on Rails over the last few weeks. Let’s jump right in!

Find and assert the presence of exactly one record

Add FinderMethods#sole and #find_sole_by to find and assert the presence of exactly one record.

Submit the same form with different HTTP methods

This change provides the ability to post the same form with different HTTP methods. For example PUT and a DELETE requests can be made from the same form.

Validate numericality with a Range

A Ruby range can now be provided as part of a numericality validator.

Improve Action Text extensibility

Allow the HTML surrounding rich text to be customized while retaining private control over how the rich text itself is rendered.

Consistently render button_to

Change Action View helpers to always render a <button> element.

Add stats to Redis Cache Store

Add a RedisCacheStore#stats method that is similar to MemCacheStore#stats.

The option config.action_view.preload_links_header was added to allow disabling of the Link header when using stylesheet_link_tag and javascript_include_tag.

Fix: Respect getter overwrites in the model

ActiveRecord::AttributeMethods::Query will now respect the getter overrides defined in the model.

45 people contributed to Rails over the last several weeks. Check out the open issues to get involved and help out. Until next week!

Rails 6.1.1 has been released

Hi everyone,

I am happy to announce that Rails 6.1.1 has been released.

CHANGES since 6.1.0

To view the changes for each gem, please read the changelogs on GitHub:

To see a summary of changes, please read the release on GitHub:

6.1.1 CHANGELOG

Full listing

To see the full list of changes, check out all the commits on GitHub.

SHA-256

If you’d like to verify that your gem is the same as the one I’ve uploaded, please use these SHA-256 hashes.

Here are the checksums for 6.1.1:

$ shasum -a 256 *-6.1.1.gem
bc156d04d7a2f5d0702e319a3e01751ccff27e54a627a1beebb3cb89dff1aefe  actioncable-6.1.1.gem
34146a9e7a3ea23824c53f42593d6a621ffc653686c186f9a379fce30737e2fa  actionmailbox-6.1.1.gem
9c4394d61b22d791c38dcf026b91039e1b5a86ea634b67fe2cd9b7cc06168f17  actionmailer-6.1.1.gem
3ecfe3b11e31e4a9e6db771244085c7783b482b82380fdce52abd11dab1153e3  actionpack-6.1.1.gem
6e749845fca914cf0ba4358d96eb8d8428b903a0192442aa9c3edfdace6c996c  actiontext-6.1.1.gem
dc9e6c2a15e66601822d089c7f4322c2a44fa86ae6c53bea57ef0bcdd8597e9f  actionview-6.1.1.gem
f35e026b49d9f53b70aece18846a641446f0bc3f78640612806330d55502a189  activejob-6.1.1.gem
b2b9d455446097e36968c009644a3c38345d1cbc449028e20a4bd43fb63fd12f  activemodel-6.1.1.gem
d10fa2c7a91b3b24a7b42b47590d3d5c46b80eb49a63c184a6cd1743ee31e9da  activerecord-6.1.1.gem
798b2806b3f485a7b65e8b39944a65ef216d39f92dfa3e7dcd0d829e5051a4b8  activestorage-6.1.1.gem
a1d7d91586b2bbebb93f931802e5b1ceab565137d0769c55d9941052de85ea22  activesupport-6.1.1.gem
b7710f82e68af72db1ffa30ff3d67437e8fb91c26255659f3c2602964b834a64  rails-6.1.1.gem
fa0818457755b22de1fc673d8e924300f8f730fc4c2a223bd9a94837f7ce81c5  railties-6.1.1.gem

As always, huge thanks to the many contributors who helped with this release.

This week in Rails: benchmark anywhere, bugfixes and more!

Hi there, it is Greg, bringing you the latest news about Rails!

Rails 6.1 released! Horizontal Sharding, Multi-DB Improvements, Strict Loading, Destroy Associations in Background, Error Objects, and more!

Rails 6.1 has been released and wow does it have a lot of great stuff! The changes include improvements to multiple databases, adding support for destroying associations in jobs instead of in-memory, turning errors into objects, and so much more.

Add benchmark method that can be called from anywhere

This PR includes the existing ActiveSupport::Benchmarkable into the Rails module, to make it accessible from anywhere (background jobs etc).

Add config.action_view.image_loading

Browser native support for lazy loading images is now a part of the official HTML standard and this PR adds Rails.application.config.action_view.image_loading to configure sitewide default for the loading html attribute to enable lazy loading sitewide without changing code.

Add config.action_view.image_decoding

Another image_tag change, which introduces Rails.application.config.action_view.image_decoding to configure the default value of the image_tag :decoding option.

Better handling of negative elements in enum

Rails gives a warning if an enum method uses the not_ prefix as it might conflict with negative scopes. The initial implementation warned even when there was no actual conflict and this change improves that and only warns about negative enums if a positive form that would cause conflicts exists.

Do not use submit_tag auto-disabling when disable_with is set to false

If we have data: { disable_with: false } then auto-disabling is turned off, but if we set automatically_disable_submit_tag to false it changes the behaviour of disable_with in an unexpected way,  so explicit usage of disable_with: false starts to enable auto-disabling with false as the value of a disabled button.
With this change auto-disabling is turned off if we have explicit disable_with: false no matter what is set in automatically_disable_submit_tag.

Ignore strict loading violations on instances loaded through fixtures

Rails 6.1 added _strict_loading_by_default _but that causes issues with the fixtures as they are lazy loaded. To get around it, this change ignores the strict loading flag when the fixtures are loaded.

Fix S3 multipart uploads when threshold is larger than the file uploaded

A bug happened when the file being uploaded to S3 is smaller than the configured multipart threshold, but this PR fixed it.

Allow reload to be default_scoped

reload was not default_scoped by default because you could be creating a record that does not match your default scope and therefore reload wouldn’t find the record. However, in the case of sharding an application you may want reload to
support default_scope because you’ll always have the correct scope
set. 

Change default queue name of all the internal jobs to be the job adapter’s

Before this change you needed to configure your job processor to handle all of Rails’ internal job queues, but not anymore!

Handle nil translation key

In Rails 6.0, the translate helper always returned nil when given a nil key, but in Rails 6.1, the translate helper always raised an I18n::ArgumentError when given a nil key. This PR fixes the translate helper to mirror the I18n.translate behaviour when given a nil key, with and without a default.

45 people contributed to Rails in the past 2 weeks. Check out the open issues if you want to be one if them next time!. Until next week!

Rails 6.1: Horizontal Sharding, Multi-DB Improvements, Strict Loading, Destroy Associations in Background, Error Objects, and more!

Rails 6.1 has been released and wow does it have a lot of great stuff! We’ve been hard at work these past few months implementing improvements to multiple databases, adding support for destroying associations in jobs instead of in-memory, turning errors into objects, and so much more.

It’s amazing how Rails has grown over the years and while we have some improvements to make to the onboarding process, Rails has never been better. The features in this release focus on adding the functionality you need to keep your application up and running for years to come.

Let’s look at some of the new functionality:

Multi-DB Improvements

Per-database Connection Switching

Rails 6.1 provides you with the ability to switch connections per-database. In 6.0 if you switched to the reading role then all database connections also switched to the reading role. Now in 6.1 if you set legacy_connection_handling to false in your configuration, Rails will allow you to switch connections for a single database by calling connected_to on the corresponding abstract class.

Horizontal Sharding

Rails 6.0 provided the ability to functionally partition (multiple partitions, different schemas) your database but wasn’t able to support horizontal sharding (same schema, multiple partitions). Rails wasn’t able to support horizontal sharding because models in Active Record could only have one connection per-role per-class. This is now fixed and horizontal sharding with Rails is available.

Additional Improvements

In addition to adding horizontal sharding support we added tons of new functionality and improved a lot of internals for multiple databases. Kyle Thompson added support for database namespaced tasks like db:schema:dump:namespace, db:schema:load:namespace, db:structure:dump:namespace, and db:structure:load:namespace. Jean Boussier from Shopify improved connection pool management.

Strict Loading Associations

In addition to the many database and connection management improvements, Aaron Patterson and Eileen M. Uchitelle added support for strict loading associations. With this feature you can ensure that all your associations are loaded eagerly and stop N+1’s before they happen. Kevin Deisz added additional support to association declarations and bogdanvlviv added support to turn strict loading on by default.

Delegated Types

Rails 6.1 adds “Delegated Types” as an alternative to single-table inheritance. This is helpful for representing class hierarchies allowing the superclass to be a concrete class that is represented by its own table. Each subclass has its own table for additional attributes. Check out the pull request written by DHH.

Destroy Associations Async

Destroy associations async adds the ability for applications to destroy associations in a background job. This can help you avoid timeouts and other performance issues in your application when destroying data. The implementation was a group effort - the PR was started by George Claghorn from Basecamp, further support added by Cory Gwin of GitHub and finalized by Rafael França and Adrianna Chang from Shopify.

Error Objects

Active Model’s errors are now objects with an interface that allows your application to more easily handle and interact with errors thrown by models. The feature was implemented by lulalala and includes a query interface, enables more precise testing, and access to error details.

Active Storage Improvements

Active Storage got a nice update in Rails 6.1! You can now configure attachments for service you want to store them in. The feature was implemented by Dmitry Tsepelev.

Additionally, Rails 6.1 adds support to Active Storage for permanent URLs for blobs. Implemented by Peter Zhu from Shopify, this feature allows configuring your attachments to use a private or public URL and ensures that public URLs will always use a permanent URL.

Disallowed Deprecation Support

If you like to run your application deprecation-warning free then this feature is for you. The feature allows applications to optionally raise an error if a deprecation warning is thrown. This is useful for making sure developers don’t reintroduce deprecation warnings that have already been fixed. The feature was implemented by Cliff Pruitt of Test Double!

Performance Improvements and Bug Fixes!

A release isn’t just about the awesome features you get. It’s also about fixing bugs, improving performance, and making Rails more stable for everyone. This release includes an improvement that avoids making a query if where passes an empty array reported by Molly Struve and the fix implemented by John Hawthorn. Eileen M. Uchitelle and Aaron Patterson also implemented a performance improvement that speeds up where queries when we know all the values are an integer.

The classic Autoloader is Deprecated

The classic autoloader has served us well since the first Rails release, but there’s a new kid on the block and it is going to start its deprecation cycle.

New Rails projects are strongly discouraged from using the classic autoloader, and we recommend that existing projects running on classic switch to zeitwerk mode when upgrading. Please check the Upgrading Ruby on Rails guide for tips.

And more!

There are so many great changes in Rails 6.1. 654 people made contributions to Rails. Check out the CHANGELOGS for more details on bug fixes, performance improvements, and other features.

Thank you to everyone who reported a bug, sent a pull request, and helped improve Rails. Rails is better because of your hard work!

Rails 6.1 RC2 and some enhancements

Hi, Wojtek from this side with a small set of changes since the last week.

Rails 6.1 RC2 released

The second release candidate for Rails 6.1 has been released and brings a more robust experience for those already trying this version.

Add option for “default_scope” to run on all queries

This change allows for applications to optionally run a default_scope
on update and delete queries in addition to current behavior on get and insert statements, by adding all_queries: true.

Add “id” and “field_id” methods to FormBuilder

Ease generating consistent DOM ids in given form context.

New default for “local” option on “form_with”

With Rails 6.1 version form_with will generate non-remote forms by default.

17 people contributed to Rails since last time. Check out the detailed list of all changes. Until next week!

Rails 6.1 RC2: Horizontal Sharding, Multi-DB Improvements, Strict Loading, Destroy Associations in Background, Error Objects, and more!

The second release candidate for Rails 6.1 has been released and brings a more robust experience for those already trying this version. We’ve been hard at work tweaking and adjusting the nobs to have so using this version is a smooth ride to everyone. The final release is scheduled to happen next week.

It’s amazing how Rails has grown over the years and while we have some improvements to make to the onboarding process, Rails has never been better. The features in this release focus on adding the functionality you need to keep your application up and running for years to come.

Let’s look at some of the new functionality:

Multi-DB Improvements

Per-database Connection Switching

Rails 6.1 provides you with the ability to switch connections per-database. In 6.0 if you switched to the reading role then all database connections also switched to the reading role. Now in 6.1 if you set legacy_connection_handling to false in your configuration, Rails will allow you to switch connections for a single database by calling connected_to on the corresponding abstract class.

Horizontal Sharding

Rails 6.0 provided the ability to functionally partition (multiple partitions, different schemas) your database but wasn’t able to support horizontal sharding (same schema, multiple partitions). Rails wasn’t able to support horizontal sharding because models in Active Record could only have one connection per-role per-class. This is now fixed and horizontal sharding with Rails is available.

Additional Improvements

In addition to adding horizontal sharding support we added tons of new functionality and improved a lot of internals for multiple databases. Kyle Thompson added support for database namespaced tasks like db:schema:dump:namespace, db:schema:load:namespace, db:structure:dump:namespace, and db:structure:load:namespace. Jean Boussier from Shopify improved connection pool management.

Strict Loading Associations

In addition to the many database and connection management improvements, Aaron Patterson and Eileen M. Uchitelle added support for strict loading associations. With this feature you can ensure that all your associations are loaded eagerly and stop N+1’s before they happen. Kevin Deisz added additional support to association declarations and bogdanvlviv added support to turn strict loading on by default.

Delegated Types

Rails 6.1 adds “Delegated Types” as an alternative to single-table inheritance. This is helpful for representing class hierarchies allowing the superclass to be a concrete class that is represented by its own table. Each subclass has its own table for additional attributes. Check out the pull request written by DHH.

Destroy Associations Async

Destroy associations async adds the ability for applications to destroy associations in a background job. This can help you avoid timeouts and other performance issues in your application when destroying data. The implementation was a group effort - the PR was started by George Claghorn from Basecamp, further support added by Cory Gwin of GitHub and finalized by Rafael França and Adrianna Chang from Shopify.

Error Objects

Active Model’s errors are now objects with an interface that allows your application to more easily handle and interact with errors thrown by models. The feature was implemented by lulalala and includes a query interface, enables more precise testing, and access to error details.

Active Storage Improvements

Active Storage got a nice update in Rails 6.1! You can now configure attachments for service you want to store them in. The feature was implemented by Dmitry Tsepelev.

Additionally, Rails 6.1 adds support to Active Storage for permanent URLs for blobs. Implemented by Peter Zhu from Shopify, this feature allows configuring your attachments to use a private or public URL and ensures that public URLs will always use a permanent URL.

Disallowed Deprecation Support

If you like to run your application deprecation-warning free then this feature is for you. The feature allows applications to optionally raise an error if a deprecation warning is thrown. This is useful for making sure developers don’t reintroduce deprecation warnings that have already been fixed. The feature was implemented by Cliff Pruitt of Test Double!

Performance Improvements and Bug Fixes!

A release isn’t just about the awesome features you get. It’s also about fixing bugs, improving performance, and making Rails more stable for everyone. This release includes an improvement that avoids making a query if where passes an empty array reported by Molly Struve and the fix implemented by John Hawthorn. Eileen M. Uchitelle and Aaron Patterson also implemented a performance improvement that speeds up where queries when we know all the values are an integer.

The classic Autoloader is Deprecated

The classic autoloader has served us well since the first Rails release, but there’s a new kid on the block and it is going to start its deprecation cycle.

New Rails projects are strongly discouraged from using the classic autoloader, and we recommend that existing projects running on classic switch to zeitwerk mode when upgrading. Please check the Upgrading Ruby on Rails guide for tips.

And more!

There are so many great changes in Rails 6.1. 686 people made contributions to Rails. Check out the CHANGELOGS for more details on bug fixes, performance improvements, and other features.

Thank you to everyone who reported a bug, sent a pull request, and helped improve Rails. Rails is better because of your hard work!

We hope you test out Rails 6.1 and love it as much as we do. Please report any bugs to the Rails issue tracker.