lib/realogy/app/models/realogy/entity.rb in realogy-0.1.0 vs lib/realogy/app/models/realogy/entity.rb in realogy-0.2.0
- old
+ new
@@ -8,10 +8,10 @@
def needs_updating?
self.new_record? || self.last_update_on_changed? || self.data.blank?
end
def self.triage hash
- @object = self.find_or_initialize_by(entity_id: hash["entityId"])
+ @object = self.find_or_initialize_by(entity_id: [hash["entityId"], hash["id"]].compact.first)
@object.last_update_on = hash["lastUpdateOn"]
@object.populate if @object.needs_updating?
end
def populate