lib/realogy/tasks/realogy.rake in realogy-0.4.9 vs lib/realogy/tasks/realogy.rake in realogy-0.5.0
- old
+ new
@@ -94,10 +94,10 @@
def perform_delta_update_for klass, since
return unless %w(agents companies listings offices teams).include?(plural = klass.to_s.tableize.split("/").last)
call = "get_#{plural}_delta".to_sym
Realogy::DataSync.client.send(call, {since: since.to_i.minutes.ago}).each do |hash|
- case Hash(hash["action"])
+ case hash["action"] rescue nil
when "Delete"
klass.find_by(entity_id: hash["id"]).try(:destroy)
when "Upsert"
hash["class"] = klass.to_s
active_job_configured? ? PopulateRealogyEntityJob.perform_later(hash) : klass::triage(hash)