From 1aee8c09daf9c75baa07d9696b29f193a1d547ea Mon Sep 17 00:00:00 2001 From: Godwin Date: Sun, 4 May 2014 15:39:08 -0600 Subject: [PATCH] Translation migrations --- lib/tasks/translations.rake | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/tasks/translations.rake b/lib/tasks/translations.rake index 26c217d..d1979d7 100644 --- a/lib/tasks/translations.rake +++ b/lib/tasks/translations.rake @@ -9,11 +9,10 @@ namespace :translations do if t['data'] t['data'].each { |tt| hash = ActiveSupport::JSON.decode(tt) - translation = Translation.find(hash['id']) - if translation - #t.assign_attributes(hash) + begin + translation = Translation.find(hash['id']) translation.update_attributes(hash) - else + rescue Translation.new(hash).save end }