From fa2736b6f6adb6ace19cdc42166fac5d81840169 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Tue, 28 Oct 2014 14:56:39 +0800 Subject: [PATCH] fix for something --- app/controllers/upgrade_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/upgrade_controller.rb b/app/controllers/upgrade_controller.rb index 679c74e..cb6ffc4 100644 --- a/app/controllers/upgrade_controller.rb +++ b/app/controllers/upgrade_controller.rb @@ -52,8 +52,8 @@ class UpgradeController < ApplicationController } end text = {"en" => "", "zh_tw" => ""} - text["en"] = smart_convertor(b.text_translations["en"]) if !b.text_translations["en"].nil? - text["zh_tw"] = smart_convertor(b.text_translations["zh_tw"]) if !b.text_translations["en"].nil? + text["en"] = (b.text_translations["en"].nil? ? "" :smart_convertor(b.text_translations["en"])) + text["zh_tw"] = (b.text_translations["zh_tw"].nil? ? "" : smart_convertor(b.text_translations["zh_tw"])) { "id" => b.id.to_s,