Module: Mongoid::Verbalize::ClassMethods
- Defined in:
- lib/mongoid/verbalize.rb
Instance Method Summary collapse
- #validates_all_locales(names, options = {}) ⇒ Object
- #validates_default_locale(names, options = {}) ⇒ Object
- #validates_one_locale(names, options = {}) ⇒ Object
- #verbalized_field(name, options = {}) ⇒ Object
Instance Method Details
#validates_all_locales(names, options = {}) ⇒ Object
31 32 33 |
# File 'lib/mongoid/verbalize.rb', line 31 def validates_all_locales(names, = {}) validates_with VerbalizedValidator, .merge(:mode => :all_locales, :attributes => names) end |
#validates_default_locale(names, options = {}) ⇒ Object
23 24 25 |
# File 'lib/mongoid/verbalize.rb', line 23 def validates_default_locale(names, = {}) validates_with VerbalizedValidator, .merge(:mode => :only_default, :attributes => names) end |
#validates_one_locale(names, options = {}) ⇒ Object
27 28 29 |
# File 'lib/mongoid/verbalize.rb', line 27 def validates_one_locale(names, = {}) validates_with VerbalizedValidator, .merge(:mode => :one_locale, :attributes => names) end |
#verbalized_field(name, options = {}) ⇒ Object
19 20 21 |
# File 'lib/mongoid/verbalize.rb', line 19 def verbalized_field(name, = {}) field(name, .merge(:type => TranslatedString, :default => {})) end |