Module: Validatable::Model::ClassMethods

Includes:
Validatable::Macros
Defined in:
lib/mongo/model/integration/validatable.rb

Instance Method Summary collapse

Instance Method Details

#validate(validation = nil, &block) ⇒ Object



28
29
30
# File 'lib/mongo/model/integration/validatable.rb', line 28

def validate validation = nil, &block
  validations.push block || validation
end

#validates_uniqueness_of(*args) ⇒ Object



24
25
26
# File 'lib/mongo/model/integration/validatable.rb', line 24

def validates_uniqueness_of *args
  add_validations(args, ::Validatable::UniquenessValidator)
end