rails 7.2.2
Active Support
-
Include options when instrumenting
ActiveSupport::Cache::Store#deleteandActiveSupport::Cache::Store#delete_multi.Adam Renberg Tamm
-
Print test names when running
rails test -vfor parallel tests.John Hawthorn, Abeid Ahmed
Active Model
-
Fix regression in
alias_attributeto work with user defined methods.alias_attributewould wrongly assume the attribute accessor was generated by Active Model.class Person include ActiveModel::AttributeMethods define_attribute_methods :name attr_accessor :name alias_attribute :full_name, :name end person.full_name # => NoMethodError: undefined method `attribute' for an instance of PersonJean Boussier
Active Record
-
Fix support for
query_cache: falseindatabase.yml.query_cache: falsewould no longer entirely disable the Active Record query cache.zzak
-
Set
.attributes_for_inspectto:allby default.For new applications it is set to
[:id]in config/environment/production.rb.In the console all the attributes are always shown.
Andrew Novoselac
-
PG::UnableToSend: no connection to the serveris now retryable as a connection-related exceptionKazuma Watanabe
-
Fix marshalling of unsaved associated records in 7.1 format.
The 7.1 format would only marshal associated records if the association was loaded. But associations that would only contain unsaved records would be skipped.
Jean Boussier
-
Fix incorrect SQL query when passing an empty hash to
ActiveRecord::Base.insert.David Stosik
-
Allow to save records with polymorphic join tables that have
inverse_ofspecified.Markus Doits
-
Fix association scopes applying on the incorrect join when using a polymorphic
has_many through:.Joshua Young
-
Fix
dependent: :destroyfor bi-directional has one through association.Fixes #50948.
class Left < ActiveRecord::Base has_one :middle, dependent: :destroy has_one :right, through: :middle end class Middle < ActiveRecord::Base belongs_to :left, dependent: :destroy belongs_to :right, dependent: :destroy end class Right < ActiveRecord::Base has_one :middle, dependent: :destroy has_one :left, through: :middle endIn the above example
left.destroywouldn't destroy its associatedRightrecord.Andy Stewart
-
Properly handle lazily pinned connection pools.
Fixes #53147.
When using transactional fixtures with system tests to similar tools such as capybara, it could happen that a connection end up pinned by the server thread rather than the test thread, causing
"Cannot expire connection, it is owned by a different thread"errors.Jean Boussier
-
Fix
ActiveRecord::Base.withto accept more than two sub queries.Fixes #53110.
User.with(foo: [User.select(:id), User.select(:id), User.select(:id)]).to_sql undefined method `union' for an instance of Arel::Nodes::UnionAll (NoMethodError)The above now works as expected.
fatkodima
-
Properly release pinned connections with non joinable connections.
Fixes #52973
When running system tests with transactional fixtures on, it could happen that the connection leased by the Puma thread wouldn't be properly released back to the pool, causing "Cannot expire connection, it is owned by a different thread" errors in later tests.
Jean Boussier
-
Make Float distinguish between
float4andfloat8in PostgreSQL.Fixes #52742
Ryota Kitazawa, Takayuki Nagatomi
-
Fix an issue where
.left_outer_joinsused with multiple associations that have the same child association but different parents does not join all parents.Previously, using
.left_outer_joinswith the same child association would only join one of the parents.Now it will correctly join both parents.
Fixes #41498.
Garrett Blehm
-
Ensure
ActiveRecord::Encryption.configis always ready before access.Previously,
ActiveRecord::Encryptionconfiguration was deferred untilActiveRecord::Basewas loaded. Therefore, accessingActiveRecord::Encryption.configproperties beforeActiveRecord::Basewas loaded would give incorrect results.ActiveRecord::Encryptionnow has its own loading hook so that its configuration is set as soon as needed.When
ActiveRecord::Baseis loaded, even lazily, it in turn triggers the loading ofActiveRecord::Encryption, thus preserving the original behavior of having its config ready before any use ofActiveRecord::Base.Maxime Réty
-
Add
TimeZoneConverter#==method, so objects will be properly compared by their type, scale, limit & precision.Address #52699.
Ruy Rocha
Action View
- No changes.
Action Pack
-
Fix non-GET requests not updating cookies in
ActionController::TestCase.Jon Moss, Hartley McGuire
Active Job
- No changes.
Action Mailer
- No changes.
Action Cable
- No changes.
Active Storage
- No changes.
Action Mailbox
- No changes.
Action Text
- No changes.
Railties
- No changes.
Guides
- No changes.