Delete the deprecated constant ActiveRecord::ImmutableRelation

This commit is contained in:
Xavier Noria 2024-07-13 12:51:40 +02:00
parent 5b0e7a31bb
commit 32c5a358bb
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