This Week in Rails

October 4, 2024

Make Float distinguish between float4 and float8 in PostgreSQL and more

Hi, it’s Greg, bringing to you the latest changes from Rails, while recovering from an amazing Rails World experience.

Make ActionController::AllowBrowser::BrowserBlocker private
To reduce the API surface area of the allow_browser feature, this commit marks the class as private API.

Change ActiveSupport::HashWithIndifferentAccess#stringify_keys to stringify all keys not just symbols
This pull request changes ActiveSupport::HashWithIndifferentAccess#stringify_keysto stringify all keys, not just symbols.
Before the change:
{ 1 => 2 }.with_indifferent_access.stringify_keys[1] # => 2

After this change:
{ 1 => 2 }.with_indifferent_access.stringify_keys["1"] # => 2


Make Float distinguish between float4 and float8 in PostgreSQL
This pull request fixes the issue when dumping a PostgreSQL schema that includes a float4 column (defined as float(24)), the column is represented as float in the generated schema dump. However, when loading this schema, the float4 column is converted to float8.

Allow ActiveRecord::QueryMethods#pluck to accept hash args with symbol & string values
The pluck was recently changed to accept hash values as an argument, and this pull request enables to use symbol and string hash values when using the method.

Raise an error when invalid :on or :except options are given to #resource or #resources
This pull requests changes these routing helpers to raise an error when a non-existing option is passed to on or except.

You can view the whole list of changes here. We had 37 contributors to the Rails codebase this past week!

Until next time!

About This Week in Rails

Your weekly inside scoop of interesting commits, pull requests and more from Rails.