Module: ActiveData::Model::Primary::PrependMethods

Defined in:
lib/active_data/model/primary.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/active_data/model/primary.rb', line 42

def ==(other)
  if other.instance_of?(self.class) && has_primary_attribute?
    if primary_attribute
      primary_attribute == other.primary_attribute
    else
      object_id == other.object_id
    end
  else
    super(other)
  end
end