Module: Mongoid::Validations::ClassMethods
- Defined in:
- lib/mongoid/validations.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#validates_associated(*args) ⇒ Object
Validates whether or not an association is valid or not.
-
#validates_uniqueness_of(*args) ⇒ Object
Validates whether or not a field is unique against the documents in the database.
Instance Method Details
#validates_associated(*args) ⇒ Object
Validates whether or not an association is valid or not. Will correctly handle has one and has many associations.
81 82 83 |
# File 'lib/mongoid/validations.rb', line 81 def validates_associated(*args) validates_with(AssociatedValidator, _merge_attributes(args)) end |
#validates_uniqueness_of(*args) ⇒ Object
Validates whether or not a field is unique against the documents in the database.
98 99 100 |
# File 'lib/mongoid/validations.rb', line 98 def validates_uniqueness_of(*args) validates_with(UniquenessValidator, _merge_attributes(args)) end |