Hi, it’s Greg. Let’s explore this week’s changes in the Rails codebase.
Eliminate queries loading dumped model schema on Postgres
This pull request improves resiliency by avoiding the need to open a database connection to load the type map, while defining attribute methods at boot, when a schema cache file is configured on PostgreSQL databases.
Allow passing in a date or time to ActiveSupport::Testing::TimeHelpers#freeze_time
This change allows the #freeze_time testing helper to accept a date or time argument.
This change allows the #freeze_time testing helper to accept a date or time argument.
Time.current # => Sun, 09 Jul 2024 15:34:49 EST -05:00 freeze_time Time.current + 1.day sleep 1 Time.current # => Mon, 10 Jul 2024 15:34:49 EST -05:00
Make column name optional for index_exists?
This pull request makes the column name optional for index_exists?. It aligns well with remove_index signature, where the index name doesn’t need to be derived from the column names.
Add a script for using dev containers outside VSCode
I you want to use the devcontainer info, but don’t want to use VSCode, the small script added by this pull request will be handy. It reads the devcontainer JSON file and runs docker commands based on the information in the JSON file.
I you want to use the devcontainer info, but don’t want to use VSCode, the small script added by this pull request will be handy. It reads the devcontainer JSON file and runs docker commands based on the information in the JSON file.
Add application-name metadata to application layout
To better support Progressive Web Apps(PWAs), this pull request adds an application-name meta tag to application layout.
JSON serialized attributes can return symbolized keys
With this change, options can now be passed to ActiveRecord::Coder::JSON when instantiating the coder. This allows to pass in the symbolize_names option for instance:
serialize :config, coder: ActiveRecord::Coder::JSON.new(symbolize_names: true)
Deprecate insert_all with unpersisted associations
This pull request deprecates using insert_all/upsert_all with unpersisted records in associations. Using these methods on associations containing unpersisted records will now show a deprecation warning, as the unpersisted records will be lost after the operation. This will become an error in Rails 8.2.
You can view the whole list of changes here. We had 34 contributors to the Rails codebase this past week!
Until next time!