Module: Mongoid::Verbalize::ClassMethods

Defined in:
lib/mongoid/verbalize.rb

Instance Method Summary collapse

Instance Method Details

#validates_all_locales(names, options = {}) ⇒ Object



31
32
33
# File 'lib/mongoid/verbalize.rb', line 31

def validates_all_locales(names, options = {})
  validates_with VerbalizedValidator, options.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, options = {})
  validates_with VerbalizedValidator, options.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, options = {})
  validates_with VerbalizedValidator, options.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, options = {})
  field(name, options.merge(:type => TranslatedString, :default => {}))
end