Module: ZLocalize::Translatable::TranslatedColumns::InstanceMethods

Defined in:
lib/zlocalize/rails/translated_columns.rb

Instance Method Summary collapse

Instance Method Details

#read_translated_column(col_name, locale, fetch_default = true) ⇒ Object



53
54
55
56
57
58
59
60
61
# File 'lib/zlocalize/rails/translated_columns.rb', line 53

def read_translated_column(col_name,locale,fetch_default = true)
  s = self.send("#{col_name}_#{locale}")
  if !s.nil?
    return s
  elsif fetch_default == true
    return self.send("#{col_name}_#{ZLocalize.default_locale}")
  end
  nil
end