class ActiveRecord::Associations::CollectionProxy
def ==(other)
person.pets == other
other = [Pet.new(id: 1), Pet.new(id: 2)]
# => true
person.pets == other
other = person.pets.to_ary
# ]
# #
# #
# => [
person.pets
end
has_many :pets
class Person < ActiveRecord::Base
+false+.
to the corresponding element in the +other+ array, otherwise returns
contain the same number of elements and if each element is equal
Equivalent to Array#==. Returns +true+ if the two arrays
def ==(other) load_target == other end