Performance improvements, large file uploads to S3 and more!

Hello fellow Rubyist!

This is Greg, bringing the latest news about the Rails framework!

Fill a Trix editor easily in system tests

ActionDispatch::SystemTestCase#fill_in_rich_text_area  can  locate and fill a Trix editor with the given HTML in your system tests.

ActiveRecord#respond_to? performance improvements

The changes introduced by this pull request made ActiveRecord#respond_to?  1.5x faster and it also no longer allocates strings.

Permit uploading files larger than 5 GB to S3

If you are using S3 with Active Storage, now you can upload large files and the services will transparently switch to streaming.

HashWithIndifferentAccess#initialize performance improvement

With this change, a quite expensive to_hash call is bypassed in the constructor if we are already dealing with a hash.

Expose mailbox_for method in ApplicationMailbox

Rails 6 is bringing Action Mailbox and with this change, it will be possible to check which mailbox an email is routed to without processing it.

40 people contributed to Rails in the last week. If you want to be part of that, check out the list of open issues.

Until next time!

Rails 6.0.0.rc1 is here, say hi at RailsConf!

Hop aboard fellow traveler! Here’s your friendly conductor Kasper revving up to give you a brand spanking new issue for the price of zilch.

We’re just about to roll into RailsConf proper. Several of your trusty editors are going including me, Eugene, Tim, and Vipul! Many people who are Rails committers and core will be there too. Feel free to say hi if you spot us — we don’t byte a bit 😄

Rails 6.0.0.rc1 is out!

Rails 6 is almost out the door. The first release candidate came out this week. This is the best time to get bug fixes in because we on the Rails core team will prioritize bugs found in rc1 and then ship an rc2 shortly. If no bugs are found after roughly 2-3 weeks, the real 6.0.0 is cut.

Model errors as objects

Now that 6.0.0.rc1 is out Rails 6.1 development has started too. And the first feature has already landed! Active Model validations has long had errors that were plain hashes, but in 6.1 they’ll be objects!

Check Zeitwerk compatibility

Rails 6’s new autoloader Zeitwerk got a new command to check if your app is compatible. Simply run bin/rails zeitwerk:check and it’ll print out potential problems.

Reuse retry logic for old jobs

One of the benefits of GitHub being on the latest Rails was seen this week as they could test 6.0. GitHub found a potential regression in Active Job rectified it. The fix is Le Git!

10% faster Active Record attribute access

Due to some nifty code rearrangement accessing attributes of an Active Record model became 10% faster albeit with a slight maintenance cost. An additional 20% speed boost on id was also squeezed in.

34 people contributed to Rails in the last week. You can see the full list of changes here.

Until next time!

Rails 6.0.0 rc1 released

Okay, so we didn’t quite make our aspirational release schedule, but Rails 6 is now almost ready, so here’s the first release candidate! There isn’t anything remarkably new compared to the beta releases, but everything has been polished (in about 1000 commits!), and we believe this candidate could become the final release, lest we find any egregious bugs.

This may well also be the best exercised release candidate in the history of Rails! The team at Basecamp, Shopify, and GitHub are all running either rc1 or just-about in production. It’s been a real pleasure to see the Shopify and GitHub teams leap to the front of the line running the latest in production.

If it’s good enough for Basecamp, Shopify, and GitHub, it’s probably good enough for you too! (But please do test, file bugs, and help us certify that it actually is).

If you’re starting a new application today, you should definitely be starting it on 6.0.0.rc1. And if you’re running an existing application under active development, you should probably also upgrade. Doing so will help us flush out the last issues before the final release.

You can read all about what’s new in Rails 6.0.0 in the first beta announcement. From Action Mailbox to Action Text, multiple database support, parallel testing, and Webpacker handling JavaScript by default. This is a massive step forward for Rails.

Also, kudos to Sam Ruby, David Bryant Copeland, and the crew at The Pragmatic Programmers for having a beta of Agile Web Development with Rails 6 ready to coincide with rc1.

Finally, we can’t wait to see everyone at a sold-out RailsConf in Minneapolis next week. It’s never been a better time to be programming with Rails.

This release, and all releases leading up to Rails 6.0 final, was shepherded by release manager Rafael França with support by Kasper Timm Hansen.

Performance improvements, collection cache versioning and more

Hello. This is Wojtek reporting on recent changes from Rails world.

Collection cache versioning

Add cache_version on relation to support recyclable cache keys via the versioned entries in ActiveSupport::Cache. This also means that cache_key will now return a stable key that does not include the max timestamp or count any more.

Speed up dirty tracking

Reports 2x ~ 30x faster execution time compared to original implementation.

Add dirty methods for store accessors

It is now possible to use methods defined by Dirty module on store accessors.

Add after_save_commit callback shortcut

Adds shortcut for very common case:

after_commit :hook, on: [ :create, :update ]

Notes tags registration

It is now possible to register custom tags that will be included on bin/rails notes command.

Add db:prepare rake task

Based on state of database it runs setup or migrate tasks.

Add detach_from to ActiveSupport::Subscriber

It is now possible to opt-out from listening on chosen events.

Factorize bin/update in bin/setup

Replaced two files with one. From now on bin/setup should be idempotent in the project, thus should run fine on the first time setup and after any update.

71 people contributed to Rails in the last 3 weeks. You can see the full list of changes here.

Until next time!

New versions of Rails, optimizer hints, ROFL, and more

Hi there! This is Daniel reporting from Brooklyn, NY.

New versions of Rails released

Rails 5.2.3 and Rails 5.1.7 were released last week. Check out the CHANGELOG and upgrade today!

Optimizer Hints and Annotations

These two related PRs were opened within a couple hours of each other. The new optimizer_hints method offers a simple way to include optimizer hints in your queries. The new annotate method offers a simple way to annotate your queries with comments.

The best PR that I saw this year!

This PR elegantly ensures that ActiveSupport::SafeBuffer’s sub, sub!, gsub, and gsub! methods set back references. I learned a lot about Ruby by reading through this code and the review comments.

Stop ROFL

I always enjoy removing code that is no longer needed. It must be especially fun to remove code that includes the comment “I will explain the roflscale so that others will not rm this code.”

Use weak references in the descendants tracker

Nobody wants a memory leak. Keeping track of these references allows us to garbage collect anonymous subclasses.

Advancing to dates before 1001-03-07

I am constantly plagued by bugs related to time. This PR reminds me how complicated time really is.

Allow disabling of console sandbox

Has anybody else ever opened a production console session and fogotten to close it? ✋ Ever done it with the --sandbox flag and caused your database to run out of memory? 😭 Thanks, Rails, for protecting me against myself.

Improved error messages from views

Thinking about contributing to Rails? Check out this PR from a first-time contributor for inspiration.

55 people contributed to Rails in the last 2 weeks, including 6 first-time contributors. You can see the full list of changes here.

Rails 5.2.3 has been released

Hi everyone,

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

CHANGES since 5.2.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:

5.2.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 5.2.3:

$ shasum -a 256 *-5.2.3.gem
755e335b8b064592717157057a647ba1c4d519be2a912f11c3993e8d5c4e8d13  actioncable-5.2.3.gem
8a6fbf3f52243cdc194c289a417856355899bcc99ec2868300a2b26f40f58a96  actionmailer-5.2.3.gem
81830a59e18d7570386a01bb332538ddf0926b5ed7566646ef608a78825751e8  actionpack-5.2.3.gem
9064ef94411d98cf7c7cc0fb179319b92a880f51f8e0671cceaf8081dccb89ec  actionview-5.2.3.gem
faa055b4986b0d3183ebd8169d82ef491dc947e075e777af2f91ead557fc719f  activejob-5.2.3.gem
d04c4367fd41a2d8767be08e9caadc617e6f825025079854562100145b82f055  activemodel-5.2.3.gem
fc6ef79f341d32b5690a7cb5a26245c33c3d2e4a7c99bb7d1c0089549c19c034  activerecord-5.2.3.gem
53eafa1e02a3c99367ffdf81e6f0f337a7d456e1a85e14cf182e702c6f343a12  activestorage-5.2.3.gem
2856b0036869e89043f5c870a1a99d2c811785130fea4affad83cf971db91b84  activesupport-5.2.3.gem
f9b51b66a91d556d63d36d04449ecc23867683f99531db21eb7a263be2d7ecdc  rails-5.2.3.gem
042388decffb47dab796e4ddb30a2d615047d7c334de7fe47208545e1677c9be  railties-5.2.3.gem

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

Rails 5.1.7 has been released

Hi everyone,

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

CHANGES since 5.1.6

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:

5.1.7 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 5.1.7:

$ shasum -a 256 *-5.1.7.gem
c344a1b4edd4108b93b341343106e73466d8bbf0a79c926a62c74f6b22984ec1  actioncable-5.1.7.gem
f053e043f0e83b7758b56af7fe21aa3ab2f61787e2edc6a1198acc8d3645fbbe  actionmailer-5.1.7.gem
a2406a8346f95294ad9342c1535e2cc4f04e7c084e71359bae224650581bd17f  actionpack-5.1.7.gem
871ca9cae0524e937543510104555c1e8d87f180b14ce0a03fe62c69012a5244  actionview-5.1.7.gem
f44a4691d7fca6b0f08c2dbd5c81110f428d5c8ade9c6a6b8e09c7984741a55c  activejob-5.1.7.gem
709bb03d9c950353e8f70e0ed4f12154c346d492e5bf6ea53b515413c740fc1e  activemodel-5.1.7.gem
5a1f4bf7b5e5c05a3e21e9207f1336eab026b3dfd794a37eeee4a4c81cfe8544  activerecord-5.1.7.gem
216db77f40e41dab82328321c375f519de8c898dcc2b88a5319d3608928fd07e  activesupport-5.1.7.gem
8d7f527c446de3f99ec506e6a680c42c38979a44b37beb15f7d451a33e74dcf5  rails-5.1.7.gem
c874ebb682f628cfe075c3b9762d3b2ff1a04585c25a2f4eb3840c4b29d73e72  railties-5.1.7.gem

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

Rails 5.1.7.rc1 has been released!

Hi everyone,

I am happy to announce that Rails 5.1.7.rc1 has been released.

This is going to be the final bug fix release for the 5.1 series, so please make sure you test the release candidates to make sure no regressions are found.

If no regressions are found, expect the final release on Wednesday, March 27, 2019. If you find one, please open an issue on GitHub and mention me (@rafaelfranca) on it, so that we can fix it before the final release.

CHANGES since 5.1.6

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:

5.1.7.rc1 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 5.1.7.rc1:

$ shasum -a 256 *-5.1.7.rc1.gem
4b50c8213b6b4846f35d994991458da797185f9e0ca92063131a59f5890bb5e3  actioncable-5.1.7.rc1.gem
65c84a566b58a4faf10e02abe4dd09f5d7101cfb79896cbf3bfb0d623c06f07b  actionmailer-5.1.7.rc1.gem
8c230b21146c155793c874da49f032be595343df4e8cca59b4be172d10b95e5a  actionpack-5.1.7.rc1.gem
cd9b9acf025c99c113155192622ebb333c729e8a99dea43d91c6016bdb287e0b  actionview-5.1.7.rc1.gem
3308343948ca041b58068c34cc312de1b867f46c8feaf997421ce4e182d8a2e7  activejob-5.1.7.rc1.gem
9ad6fc7f9cb05b5d38462672315b4b05863d263ba46b035367d7e290dc7dd160  activemodel-5.1.7.rc1.gem
4940e5f4c2e4cc1ca8e2d3d41ebf514e5d315e1f39884d518e22e8600b7b0d22  activerecord-5.1.7.rc1.gem
26e956e7b2d16e0783f48ae05e6822da2aabac96ecf1f3b78d6e035145f10b6c  activesupport-5.1.7.rc1.gem
ca0f895446ceece1d904e96bedff90224e715acb9f124b60ffc9ac1b568ed07d  rails-5.1.7.rc1.gem
bbd0b366890da1c6baa3bd68c3132e499f53143351b7ab382c661a0fb9f07ac1  railties-5.1.7.rc1.gem

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

Rails 5.2.3.rc1 has been released!

Hi everyone,

I am happy to announce that Rails 5.2.3.rc1 has been released.

If no regressions are found, expect the final release on Wednesday, March 27, 2019. If you find one, please open an issue on GitHub and mention me (@rafaelfranca) on it, so that we can fix it before the final release.

CHANGES since 5.2.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:

5.2.3.rc1 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 5.2.3.rc1:

$ shasum -a 256 *-5.2.3.rc1.gem
353ad8bf6ae456c3392d2d38817263b242eafb8c36a56dc39ef168dba85913cf  actioncable-5.2.3.rc1.gem
489322d94165891a2aa3a5274f54fbba75f06d669d490bd265170356bcf8dd7e  actionmailer-5.2.3.rc1.gem
7b55fa598d3c4826112d482bafb2f34c94457bc142a2989cae56fdd4282212c8  actionpack-5.2.3.rc1.gem
43c69fc7e4f0088d67db47b048785d00568706e5959bd634d9c4b8c59bba6f85  actionview-5.2.3.rc1.gem
350e2e04dc5e18c69f8d9aa2b784bc30c170d4b8ea152fbb3a4a28423b6c639b  activejob-5.2.3.rc1.gem
c4e52ac78e393f30c3f553f772942d0e6b5834baa3046a4c7a5db028f894b414  activemodel-5.2.3.rc1.gem
8c4858ccee67a420f5c4cea16c558e8502eb7fa72808d532dc1ef33586fb23b1  activerecord-5.2.3.rc1.gem
c83e05b7906ae4f9c657d46fc007acb3ef6c2ad602e633980bc22e59a0c7aa5c  activestorage-5.2.3.rc1.gem
88e334741d202bf95ebdf0d8db54b7abb299ecdb6e516d7b5033c19ad6f3dedf  activesupport-5.2.3.rc1.gem
419a56071b85f5496de89810700d6bfab8c373ceb8beccc3052bbb6c8e3fc6b3  rails-5.2.3.rc1.gem
1a907c12473dec3cd543099245d7a23c045d4b52f92eb35f38fee211ee613084  railties-5.2.3.rc1.gem

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

Security fixes, bulk insert and upsert, seeds replanting

Hello. This is Wojtek here bringing you the exciting updates from Rails.

Security fix releases of Rails

Rails 4.2.11.1, 5.0.7.2, 5.1.6.2, 5.2.2.1, and 6.0.0.beta3 have been released containing important security fixes. Note that with 6.0 release only Rails 6.x.y and Rails 5.2.x are guaranteed to receive both major and minor security fixes by Rails core.

Active Record adds “insert_all” and “upsert_all” methods

It’s now possible to insert many records at once within one SQL statement. You can check summary of this feature in Josef’s blog post.

Rails command “db:seed:replant” added

Bring back clean state of database seeds with this simple command without redoing the database structure.

Active Support adds Enumerable “including” method

Self-explained by an example:

[ 1, 2, 3 ].including(4, 5) => [ 1, 2, 3, 4, 5 ]

For parity, method without was renamed to excluding.

54 people contributed to Rails in the last 2 weeks. You can see the full list of changes here.

Until next time!