Make rubocop happy again.

This commit is contained in:
Guo Xiang Tan
2018-06-07 13:28:18 +08:00
parent c6c1ef71c1
commit ad5082d969
79 changed files with 3155 additions and 3155 deletions

View File

@ -75,19 +75,19 @@ class Admin::SiteTextsController < Admin::AdminController
protected
def record_for(k, value = nil)
if k.ends_with?("_MF")
ovr = TranslationOverride.where(translation_key: k, locale: I18n.locale).pluck(:value)
value = ovr[0] if ovr.present?
end
value ||= I18n.t(k)
{ id: k, value: value }
def record_for(k, value = nil)
if k.ends_with?("_MF")
ovr = TranslationOverride.where(translation_key: k, locale: I18n.locale).pluck(:value)
value = ovr[0] if ovr.present?
end
def find_site_text
raise Discourse::NotFound unless I18n.exists?(params[:id]) && !self.class.restricted_keys.include?(params[:id])
record_for(params[:id])
end
value ||= I18n.t(k)
{ id: k, value: value }
end
def find_site_text
raise Discourse::NotFound unless I18n.exists?(params[:id]) && !self.class.restricted_keys.include?(params[:id])
record_for(params[:id])
end
end