Module: ModelFieldsI18n

Defined in:
lib/model_fields_i18n.rb,
lib/model_fields_i18n/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#t(column) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/model_fields_i18n.rb', line 4

def t(column)
  if I18n.locale == I18n.default_locale
    read_attribute(column)
  else
    read_attribute(:"#{column}_#{I18n.locale}")
  end
end