Rails 6.0.1 released

Hi everyone,

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

CHANGES since 6.0.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.0.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.0.1:

$ shasum -a 256 *-6.0.1.gem
e905a3e13e62cca763bde6c7ada869db335aec5736c306855b55953b26ec7acc  actioncable-6.0.1.gem
9723a51f65261a46746ed1ebb1044884619daa8c016ac42e4a010d22a34d10f0  actionmailbox-6.0.1.gem
9912e82fa14a56b1cec70ab3a3a3a7051ba0bb35f41834d7b5cf4f996509f4ef  actionmailer-6.0.1.gem
e5b94c53514f56bdb9273145392611ba1e3483fbd4d6a4c3fa5b8dfe2bab0632  actionpack-6.0.1.gem
7ea35140009b63907daad9818e5ae08f84b7ce5f4674a3826ca1dd8544003a67  actiontext-6.0.1.gem
cac8225dcd12a047e13b9f78646c55350679587a59262ca982eb535f0584b16d  actionview-6.0.1.gem
0cabdae0c2839637d70a527b7d5640e7012904ffdd844dda87a6d97b0774ae6a  activejob-6.0.1.gem
c0e0e20886e0b5e695af57cbd7d52b9f46b4939e6227bd536eaadadbe115f091  activemodel-6.0.1.gem
d5cd3b3fb74ce292366b17fdb2e48dcd10a015f791eee1669231ae0633be016b  activerecord-6.0.1.gem
4300352bb8f108ea08d33071166b25cb4a4cbdb9996c7a9af5c43e4bd0b53d79  activestorage-6.0.1.gem
3af069dbd4b0181fbfb209453e7fc9321594e329c553472dfa7f80ef83d81da4  activesupport-6.0.1.gem
87c242b5dbac85026ef3fe1278a51bee6d81913fb631465c4bfee2e8e8759ec8  rails-6.0.1.gem
05d4ccdbd8dc4232ed779c85a15795ecc47df5fca017f6dd483d10f2a14040f7  railties-6.0.1.gem

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

Reestablish previous connection, duplicate cached values and run inline jobs

Hello! This is Roque bringing the latest news from the Rails community.

Reestablish connection to previous database after migrating

The migrate task iterates and establish a connection over each database. That resulted in the last connection being used by subsequent rake tasks. This fix will restore the previous connection before the migrate task had started.

Duplicate the cached value before writing to the local cache

This fixed the following issue:

my_string = "foo"
cache.write('key', my_string)
my_string << "bar"
cache.read('key') # => "foobar"

Run inline jobs in separate threads

Run inline jobs in separate threads so that thread locals (e.g. current attributes) are properly scoped and reset when running jobs inline.

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

Rails 6.0.1 RC1 released

Hi everyone,

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

If no regressions are found, expect the final release on Tuesday, November 5, 2019. If you find one, please open an issue on GitHub so that we can fix it before the final release.

CHANGES since 6.0.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.0.1.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 6.0.1.rc1:

$ shasum -a 256 *-6.0.1.rc1.gem
23adccc8bade5c3bdc8d76b69a1e9988052358aad406a6ca81eb642749088e4f  actioncable-6.0.1.rc1.gem
c7f2aa9fa3767f82479ad9fd714ca97d0586c5e957d149bc4ef7ca02d8617180  actionmailbox-6.0.1.rc1.gem
58df98a5aa58bf827262dcfa1b12b45bb161a59bf2bbe50dccb2bb639b65da8d  actionmailer-6.0.1.rc1.gem
6a5ffbcc23e298f58d7e0bb3f17bfa3f95c4ada1f90b523be2757e7de029b132  actionpack-6.0.1.rc1.gem
3e410969cad6acc26604e59fe2857ed8b251418f8446e4fafcecad6306f526b0  actiontext-6.0.1.rc1.gem
9402970f158d28b74373a8c400418f42bfcc50f2ad96b4771d66d06e68eb62a3  actionview-6.0.1.rc1.gem
6e896a34c717462b4e34c8f67a707daedec83f45760b0fcedf373b4a1c536675  activejob-6.0.1.rc1.gem
1f69c1a337eaa0a0b0a76fe95a26fa0bad1d29f0bb365b35a20ebdda4eb6f56b  activemodel-6.0.1.rc1.gem
1b2471d934650cf6484e7d110c3da9fed64252a0de8f449dcd3e4df9d066283d  activerecord-6.0.1.rc1.gem
e48d836948164471e91ca8a9ef495b8c6d6976b845a13836f9572119118d74c9  activestorage-6.0.1.rc1.gem
fe62486cd9665a725304db287bc942829f9faaf6c6e243155d706351a4590439  activesupport-6.0.1.rc1.gem
eee594a0a944fc2d182a29a440c2bca62b8e55ec63ada2a77cfe003d6447e4ed  rails-6.0.1.rc1.gem
3052fa0d642aca19e1a7f44e9ad8de75576726053859a98477ceb796edb1bbd7  railties-6.0.1.rc1.gem

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

Permanent public URLs for storage blobs and more

Hello Ruby folks. Wojtek from this side reporting on latest additions to Rails codebase.

Add permanent URLs for public storage blobs

It is now possible to configure Active Storage to hold public/private blobs. Public services will always return a permanent URL.

Improve inversing associations

Adds support for inversing belongs_to -> has_many Active Record associations through a config option.

Support for overrides in “zeitwerk” mode inflectors

Helps to define custom autoload inflections independently from Active Support.

Support errors translation lookup on indexed attributes

When using indexed errors option, translated messages for them will be looked up by the standardized key.

Allow “OPTIONS” HTTP verb in routing mapper

Handy shortcut for defining routes.

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

New attribute methods, regex matching and more!

Hello! Tim here with the latest scoop on Ruby on Rails!

New *_previously_was attribute methods!

Your models just got a sprinkling of a little extra sugar. For any given attribute that changed, you can now do:

Model.attribute_previously_was # => previous value

Support for matches_regex in MySQL

Check out this PR for a great example of how you can now perform regular expression matching on your MySQL queries!

Preservation of join order fixed

This fix managed to take down a number of open issues in one go! It addresses a recent regression by ensuring that the order of any user-supplied joins will be preserved as far as Active Record is able to do so.

28 people contributed to Rails last week, including 3 for the first time. If you’d like to see yourself up there, why not check out the list of open issues. Until next time!

ActionController::Base.log_at and more!

Hi there, this is Greg, bringing you the changes in Rails from the past week. Let’s dive in!

Reduce stat(2) calls

This commit adds a slight performance improvement by reducing stat(2) calls in Rails.

Serialize symbols to strings in ImmutableString serialize method

This PR updates the immutable string class to serialize symbols to strings to mirror this behavior as ActiveModel::Attribute calls this serialize method to determine the return value for changed_in_place?. Prior to this change, this code would wrongly report that “something” had changed.

Add ActionController::Base.log_at

This PR makes it possible to set a different log level on a per request basis. 

# Use the debug level if a particular cookie is set.  class ApplicationController \< ActionController::Base  log\_at :debug, if: -\> { cookies[:debug] }  end

25 peoplecontributed to Rails last week, if you want to be part of that, check out the open issues on Github.  Until next time.

Delete multi entries from cache, bugfixes and more

Hi. This is Wojtek. Rails 6 is with us for some time and we all can see it is a stable and solid release. Thank you one more time to all that tested the pre-releases and helped in ensuring that the final version is in a best possible shape.

Now let’s see some recent additions to Rails.

Added delete_multi method to Active Support Store Cache

Improves performance for deleting many entries at once when supported by underlying store like Redis.

Serialize classes and modules with Active Job

Classes and modules can now be passed to job as argument without a need for custom serializer.

Added email_address_with_name method to Action Mailer

Properly escapes email addresses with names without worrying if it includes special characters in it.

Fixed Range include? method for endless argument

Endless range was introduced in Ruby 2.6 and beginless range in upcoming Ruby 2.7.

Fixed Active Support Duration comparison

Guard against non numeric attributes to avoid faulty comparisons.

58 people contributed to Rails since the last time. You can check the full list of changes here. Until next time.

Rails 6 excitement, connection pool reaping, bug fixes

Greetings! Daniel here, reporting from Brooklyn, NY.

Rails 6 in the wild

I know we mentioned this last week, but I am so excited I wanted to mention it again. Rails 6 has been out for a little over a week and has had over 60,000 downloads. Check it out today!

Ensure connection reaper threads respawn in forks

I didn’t know much about this part of Rails before looking at this PR. The connection pool synchronizes thread access to database connections. The reaper continuously calls reap and flush on the connection pool. I have just one question: can somebody translate Aaron Patterson’s comment for me?

Avoid reaping parent connection pool after fork

This is from the same part of Rails as above. I really enjoyed seeing the collaboration between Guo Xiang Tan and John Hawthorn in these PRs. Nice work!

Fix memoization bug in Active Record

Anmol Arora noticed and fixed an Active Record bug that has been around for years. Excellent work on your first commit to Rails!

29 people contributed to Rails over the past week, including 8 first-timers. Check out the full list of changes, and if you are interested in helping out check out the open issues. Until next time…

Rails 6 is released, sass-rails 6, improved mysql2 error and more

Hello! This is Prathamesh bringing the latest news from the Rails community. This week we have some big news. Get ready.

Rails 6 is out!

After two and half years of development from more than 800 people having staggering 7275 commits, Rails 6 is released. Time to upgrade 😁
Check out the release notes and upgrading guide to know more.

Support for sass-rails 6

Rails now works with sass-rails 6.0. sass-rails 6 wraps sassc-rails gem under the hood. This new version stops usage of outdated and unsupported ruby-sass gem.

Make prepared statement status thread and instance-specific

This fixes a race condition in system tests where prepared
statements can be incorrectly parameterized when multiple
threads observe the mutation of the @prepared_statements
instance variable on the connection.

Improve MySQL error detection

Improve detection of ActiveRecord::StatementTimeout error with mysql2 adapter in the edge case when the query is terminated during file sort.

Log potential matches when asserting active job test helpers

Adds logging of potential matches when calling assert_enqueued_with and assert_performed_with  to provide more information about test failures.

25 people contributed to Rails in the last week. Want to see your name on that list? Check out the list of issues here.

See you next week.

Rails 6.0: Action Mailbox, Action Text, Multiple DBs, Parallel Testing, Webpacker by default, and Zeitwerk

Dealing with incoming email, composing rich-text content, connecting to multiple databases, parallelizing test runs, integrating JavaScript with love, and rewriting the code loader. These are fundamental improvements to the fundamentals of working with the web and building fast and fresh applications. This is the kind of work we’ve been doing for the past fifteen years, and we’re still at it. THIS IS RAILS SIX!

And that’s just the headline improvements! Since Rails 5.2 was released a little over a year ago, we’ve continued our high pace of improvement all over the framework. In 2019 alone, we’ve had 341 code contributors submit improvements and fixes. We’ve tried to summarize just some of the goodies in the release notes, but there are many more than that.

While we took a little while longer with the final version than expected, the time was spent vetting that Rails 6 is solid. In fact, GitHub, Shopify, and Basecamp, as well as plenty of other companies and applications, have been running the pre-release version of Rails 6 for months and months in production. We might not have caught everything, but if it’s good enough for GitHub, Shopify, and Basecamp, it’s probably good enough for you too!

So what are you going to get with Rails 6? Check it out:

Action Mailbox routes incoming emails to controller-like mailboxes for processing in Rails. It ships with ingresses for Mailgun, Mandrill, Postmark, and SendGrid. You can also handle inbound mails directly via the built-in Exim, Postfix, and Qmail ingresses. The foundational work on Action Mailbox was done by George Claghorn and yours truly.

Action Text brings rich text content and editing to Rails. It includes the Trix editor that handles everything from formatting to links to quotes to lists to embedded images and galleries. The rich text content generated by the Trix editor is saved in its own RichText model that’s associated with any existing Active Record model in the application. Any embedded images (or other attachments) are automatically stored using Active Storage and associated with the included RichText model. The foundational work on Action Text was done by Sam Stephenson, Javan Makhmali, and yours truly.

The new multiple database support makes it easy for a single application to connect to, well, multiple databases at the same time! You can either do this because you want to segment certain records into their own databases for scaling or isolation, or because you’re doing read/write splitting with replica databases for performance. Either way, there’s a new, simple API for making that happen without reaching inside the bowels of Active Record. The foundational work for multiple-database support was done by Eileen Uchitelle and Aaron Patterson.

With parallel testing support, you can finally take advantage of all those cores in your machine to run big test suites faster. Each testing worker gets its own database and runs in its own thread, so you’re not pegging one CPU to 100% while the other 9 sit idle by (y’all do have a 10-core iMac Pro, right 😂). Hurray! The foundational work for parallel-testing support was done by Eileen Uchitelle and Aaron Patterson.

Webpacker is now the default JavaScript bundler for Rails through the new app/javascript directory. We’re still using the asset pipeline with Sprockets for CSS and static assets, though. The two integrate very nicely and offer the best trade-off of advanced JavaScript features with an it-just-works approach to other assets.

Xavier Noria’s new Zeitwerk code loader for Ruby. No more const_missing, no more code loading gotchas, hello Module#autoload!

Those are just some of the marque additions, but Rails 6.0 is also packed with minor changes, fixes, and upgrades. Just some I’d call out: Proper Action Cable testing, Action Cable JavaScript rewritten in ES6, protection against DNS rebinding attacks, and per-environment credentials. Also, Rails 6 will require Ruby 2.5.0+ now. You can check out everything in the individual framework CHANGELOG files for the nitty-gritty rundown.

This release was shepherded by release manager Rafael França with support by Kasper Timm Hansen.

Thanks again to everyone who keeps working on making Rails better! Thanks to everyone who uses Rails! I’m incredibly proud to see this open-source framework continue to thrive outside the pressures of market terms and reciprocal guilt. This is a gift we give each other and expect nothing in return.