From 44dccad821d3dd57bef23db9b401636aef682bc8 Mon Sep 17 00:00:00 2001 From: Matias Garcia Isaia Date: Mon, 22 Jun 2020 20:02:57 -0300 Subject: [PATCH] Fix: Contact's don't have `finished_at` but `last_activity_at` The buggy code was introduced in 10a0666709e1f96f2f4e527ca977e15fc62a087f for #741. It seems it never worked as intended - probably because the calls usually are finished by the broker instead of the web. --- app/models/call_log.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/call_log.rb b/app/models/call_log.rb index 95098fc11..d75a4c2cc 100644 --- a/app/models/call_log.rb +++ b/app/models/call_log.rb @@ -85,7 +85,7 @@ def finish(state) self.finished_at = Time.now.utc self.save! - self.contact.update_column(:last_activity_at, self.finished_at) if self.contact && self.finished_at > self.contact.finished_at + self.contact.update_column(:last_activity_at, self.finished_at) if self.contact && (self.contact.last_activity_at.nil? || self.finished_at > self.contact.last_activity_at) begin call_flow.try(:push_results, self) if call_flow && call_flow.store_in_fusion_tables