Module: Foobara::DetachedEntity::Concerns::Equality
Instance Method Summary
collapse
Methods included from Concern
foobara_class_methods_module_for, foobara_concern?, included
Instance Method Details
#==(other) ⇒ Object
12
13
14
15
16
|
# File 'foobara-0.0.110/projects/detached_entity/src/concerns/equality.rb', line 12
def ==(other)
equal?(other) || (self.class == other.class && primary_key && primary_key == other.primary_key)
end
|
#dup ⇒ Object
7
8
9
10
|
# File 'foobara-0.0.110/projects/detached_entity/src/concerns/equality.rb', line 7
def dup
self
end
|
#hash ⇒ Object
18
19
20
|
# File 'foobara-0.0.110/projects/detached_entity/src/concerns/equality.rb', line 18
def hash
(primary_key || object_id).hash
end
|