Action Cable testing utilities, bugfixes and more!

Posted by gregmolnar, August 26, 2018 @ 12:00 am in News

Happy Sunday! This is Greg bringing you the latest news about Rails.

The initializers Rake task is moved to Rails::Command

Another Rake task is moved to Rails::Command, so in Rails 6 you will need to call bin/rails initializers instead of bin/rake initializers.

Improve Active Job test helpers

This change adds a queue option to perform_enqueued_jobs, and if it is set, only the specified queue will be performed.

Fix rails routes -c

This PR fixes the issue of rails routes -c UserPermissionsController did not output routes for the corresponding controller, because its name consists of multiple words. 

Action Cable testing

This PR is basically a merge of the actioncable-testing gem into Rails, to provide testing utilities for Action Cable.

Fail more gracefully from Active Storage missing file exceptions

This PR translates service-specific missing object exceptions into one generic ActiveStorage::FileNotFoundError, so the application can fail more gracefully when a missing file is accessed.

Omit BEGIN/COMMIT statements for empty transactions

With this change, if a transaction is opened and closed without any queries being run, the BEGIN and COMMIT statements are omitted to remove the overhead, and make workarounds like save if changed? unnecessary.

Support multiple submit buttons in Active Storage forms

Often times forms have more than one submit button enabling different actions, but before this change, Active Storage used the first submit button of the form, rather than the one the user actually clicked.

28 people contributed to Rails this week. If you also want help out, check out the list of open issues! Until next time!