Module: ClientSideValidations::Rails2::ActiveRecord::Validations::ClassMethods

Defined in:
lib/client_side_validations/rails_2/active_record/validations.rb

Instance Method Summary collapse

Instance Method Details

#validates_uniqueness_of(*attr_names) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/client_side_validations/rails_2/active_record/validations.rb', line 11

def validates_uniqueness_of(*attr_names)
  options = attr_names.extract_options!
  attr_names.each do |name|
    self._validators[name] << ::ActiveRecord::Validations::UniquenessValidator.new(name, options)
  end

  super(*((attr_names << options).compact))
end