Module: ActiveModel::Validations::ClassMethods

Defined in:
lib/active_mongo_uniquenesss.rb

Instance Method Summary collapse

Instance Method Details

#validates_uniqueness_of(*attr_names) ⇒ Object



25
26
27
28
29
30
# File 'lib/active_mongo_uniquenesss.rb', line 25

def validates_uniqueness_of(*attr_names)
  options = _merge_attributes(attr_names)
  options[:message] ||= "is taken"
  options[:scope] ||= []
  validates_with UniquenessValidator, options
end