Module: Mongoid::I18n::ClassMethods
- Defined in:
- lib/mongoid/i18n.rb
Instance Method Summary collapse
- #localized_field(name, options = {}) ⇒ Object
- #validates_all_locales(names, options = {}) ⇒ Object
- #validates_default_locale(names, options = {}) ⇒ Object
- #validates_one_locale(names, options = {}) ⇒ Object
Instance Method Details
#localized_field(name, options = {}) ⇒ Object
13 14 15 |
# File 'lib/mongoid/i18n.rb', line 13 def localized_field(name, = {}) field name, .merge(:type => LocalizedField, :default => {}) end |
#validates_all_locales(names, options = {}) ⇒ Object
25 26 27 |
# File 'lib/mongoid/i18n.rb', line 25 def validates_all_locales(names, = {}) validates_with LocalizedValidator, .merge(:mode => :all_locales, :attributes => names) end |
#validates_default_locale(names, options = {}) ⇒ Object
17 18 19 |
# File 'lib/mongoid/i18n.rb', line 17 def validates_default_locale(names, = {}) validates_with LocalizedValidator, .merge(:mode => :only_default, :attributes => names) end |
#validates_one_locale(names, options = {}) ⇒ Object
21 22 23 |
# File 'lib/mongoid/i18n.rb', line 21 def validates_one_locale(names, = {}) validates_with LocalizedValidator, .merge(:mode => :one_locale, :attributes => names) end |