lib/i18n_column/base.rb in i18n_column-0.0.1 vs lib/i18n_column/base.rb in i18n_column-0.0.2
- old
+ new
@@ -17,15 +17,15 @@
def i18n_column(*col_names)
for col_name in col_names
class_eval <<-EOV
def #{col_name}
json = #{col_name}_to_json
- json.nil? ? nil : json[::I18nColumn::Language.current_lang]
+ json.nil? ? nil : json[::I18n.locale.to_s]
end
def #{col_name}=(value)
json = #{col_name}_to_json || {}
- json[::I18nColumn::Language.current_lang] = value
+ json[::I18n.locale.to_s] = value
self[:#{col_name}] = json.to_json
value
end
private