lib/active_data/model/localization.rb in active_data-1.0.0 vs lib/active_data/model/localization.rb in active_data-1.1.0

- old
+ new

@@ -1,15 +1,18 @@ +require 'active_data/model/attributes/reflections/localized' +require 'active_data/model/attributes/localized' + module ActiveData module Model module Localization extend ActiveSupport::Concern module ClassMethods - def localized *args, &block + def localized(*args, &block) add_attribute(ActiveData::Model::Attributes::Reflections::Localized, *args, &block) end - def fallbacks locale + def fallbacks(locale) ::I18n.respond_to?(:fallbacks) ? ::I18n.fallbacks[locale] : [locale] end def locale I18n.locale