Welcome to This week in Rails, your weekly inside scoop of interesting commits, pull requests and more from Rails.
As you might recall, we have been assembling a team of editors for this newsletter. This week, Washington Luiz will be delivering the latest Rails news to you. If you are interested in joining us, just let me know!
Washington will be taking over the driver's seat from here.
Core team is finally getting close to the final 4.2.0 release of our favorite Ruby framework. Please help them by running your application builds on Rails 4.2.0.rc1. Reporting any issues is greatly appreciated.
From today onwards, the master branch Rails repository will be tracking the next major version, i.e. Rails 5.0! Expect to see a whole bunch of interesting changes here soon.
Besides shipping with foreign key constraints support on migrations Rails 4.2 generators will also encourage users to do so by setting it up by default, just like indexes are also added by default.
More goodies coming to Rails mailers this week. 4.2 will ship with a default mailer layout that includes the html and body tags on every mailer template to help reduce spam scores.
The automatic test schema maintenance feature shipped in Rails 4.1 brought some issues. Bringing back that task makes it easier for plugins to integrate into the test cycle. Deprecations previously added were dropped while a better path is being set for Rails 5.0.
Helpers link_to and url_for now generate full URLs, including the protocol and hostname when called from mailer templates. No need to pass only_path: false anymore.
It is now recommended that you use the new assert_performed_jobs, assert_no_performed_jobs and assert_performed_with helpers in the block form so that the test helpers can reset the internal states between tests. Alternatively, you can also use the new perform_enqueued_jobs helper if you prefer the non-block form of those helpers.
Better support for replacing associations in memory just came in. Take a quick look at the tests for examples on how replacing a association collection works now.
Turns out the way some popular engines were doing controller tests is not adequate. Engine guides were updated to advise a better approach and a deprecation warning will show up for those still relying on the :use_route option.