lib/rasti/db/model.rb in rasti-db-1.3.1 vs lib/rasti/db/model.rb in rasti-db-1.4.0

- old
+ new

@@ -60,9 +60,13 @@ invalid_attributes = attributes.keys - self.class.attributes raise "#{self.class.model_name} invalid attributes: #{invalid_attributes.join(', ')}" unless invalid_attributes.empty? @attributes = attributes end + def merge(new_attributes) + self.class.new attributes.merge(new_attributes) + end + def eql?(other) instance_of?(other.class) && to_h.eql?(other.to_h) end def ==(other) \ No newline at end of file