Module: ActsAsLocalized::ClassMethods

Defined in:
lib/acts_as_localized.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_localized(*attributes) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/acts_as_localized.rb', line 12

def acts_as_localized *attributes
  attributes.each do |attribute|
    define_method attribute do
      send("#{attribute}_#{I18n.locale}")
    end
    define_method "#{attribute}=" do |value|
      send("#{attribute}_#{I18n.locale}=", value)
    end
  end
end