From 0f33a0fb70da1fb2aa602a6f7e02374181db6774 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Tue, 29 Mar 2016 17:44:01 +0300 Subject: [PATCH] story#114871365 - differintiate which value we're setting in if --- lib/tasks/convert.rake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/tasks/convert.rake b/lib/tasks/convert.rake index 7b5adb9a5..35e68046c 100644 --- a/lib/tasks/convert.rake +++ b/lib/tasks/convert.rake @@ -50,8 +50,8 @@ namespace :convert do count = 0 ContactVersion.find_each do |c| - if if_object = (c.object && c.object["country_code"].present? && c.object["country_code"] != c.object["country_code"].upcase) || - if_changes = (c.object_changes && c.object_changes["country_code"].present? && c.object_changes["country_code"] != c.object_changes["country_code"].map{|e|e.try(:upcase)}) + if (if_object = (c.object && c.object["country_code"].present? && c.object["country_code"] != c.object["country_code"].upcase)) || + (if_changes = (c.object_changes && c.object_changes["country_code"].present? && c.object_changes["country_code"] != c.object_changes["country_code"].map{|e|e.try(:upcase)})) if if_object h = c.object @@ -63,7 +63,6 @@ namespace :convert do h = c.object_changes h["country_code"] = h["country_code"].map{|e|e.try(:upcase)} c.object_changes = h - binding.pry end c.update_columns(object: c.object, object_changes: c.object_changes)