Merge pull request #52321 from rails/fxn/rm-ActiveRecord-ImmutableRelation

Delete the deprecated constant ActiveRecord::ImmutableRelation
This commit is contained in:
Xavier Noria 2024-07-13 13:28:24 +02:00 committed by GitHub
commit e1f8909c66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 12 deletions

@ -1,3 +1,7 @@
* Delete the deprecated constant `ActiveRecord::ImmutableRelation`.
*Xavier Noria*
* Fix duplicate callback execution when child autosaves parent with `has_one` and `belongs_to`.
Before, persisting a new child record with a new associated parent record would run `before_validation`,

@ -484,11 +484,6 @@ def initialize(model = nil, description = nil)
# relation.limit!(5) # => ActiveRecord::UnmodifiableRelation
class UnmodifiableRelation < ActiveRecordError
end
deprecate_constant(
:ImmutableRelation,
"ActiveRecord::UnmodifiableRelation",
deprecator: ActiveRecord.deprecator
)
# TransactionIsolationError will be raised under the following conditions:
#

@ -16,11 +16,4 @@ def test_can_be_instantiated_with_no_args
end
end
end
def test_active_record_immutable_relation_deprecation
expected_message = "ActiveRecord::ImmutableRelation is deprecated! Use ActiveRecord::UnmodifiableRelation instead"
assert_deprecated(expected_message, ActiveRecord.deprecator) do
assert_same ActiveRecord::UnmodifiableRelation, ActiveRecord::ImmutableRelation
end
end
end