Saturday, January 11, 2020

This week in Rails - Deprecations, bugfixes and improvements!

Posted by gregmolnar

Hello, this is Greg, bringing you the latest news from the Ruby on Rails world!

38 contributors to Rails in past week

There have been 38 contributors to Rails in the first week of the year! 

Deprecate “primary” as a connection_specification_name for ActiveRecord::Base

This PR deprecates the use of the name “primary” as the connection_specification_name for ActiveRecord::Base in favor of using “ActiveRecord::Base” to avoid confusion as earlier the classname was used in any other case.

Deprecate using Range#include? to check the inclusion of a value in a date time range

The usage of the Range#include? method to check the inclusion of an argument in date-time with zone range is deprecated in Ruby and since Rails extends it, the deprecation needs to be carried forward. As a replacement, it is recommended to use Range#cover?

Restore previous behavior of parallel test databases

Before this bugfix, if an app called establish_connection with no arguments or doesn’t call connects_to in ApplicationRecord and uses parallel testing databases, the application could’ve picked up the wrong configuration.

Reduce number of created objects in Hash#as_json

The improvement is highly coupled to the size of the hash but can be quite a bit for medium sized nested hashes.

That’s it for this week, till next time!