lib/realogy/tasks/realogy.rake in realogy-0.4.8 vs lib/realogy/tasks/realogy.rake in realogy-0.4.9
- 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["action"]
+ case Hash(hash["action"])
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)