Skip to content

Commit fcf6edf

Browse files
authored
Merge pull request rails#46449 from AlexB52/update-collection-proxy-documentation [ci-skip]
Update ActiveRecord::Associations::CollectionProxy#== documentation
2 parents dcc75f9 + a83451d commit fcf6edf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

activerecord/lib/active_record/associations/collection_proxy.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,10 +955,13 @@ def scope
955955
# person.pets == other
956956
# # => true
957957
#
958+
#
959+
# Note that unpersisted records can still be seen as equal:
960+
#
958961
# other = [Pet.new(id: 1), Pet.new(id: 2)]
959962
#
960963
# person.pets == other
961-
# # => false
964+
# # => true
962965
def ==(other)
963966
load_target == other
964967
end

0 commit comments

Comments
 (0)