Module: Dedupe::ClassMethods

Defined in:
lib/dedupe.rb

Instance Method Summary collapse

Instance Method Details

#validates_uniqueness(options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/dedupe.rb', line 15

def validates_uniqueness(options={})
  self.dedupe_scope_name = options.delete :using
  if defined?(Mongoid::Document) && self.new.is_a?(Mongoid::Document)
    self.send :include, Orm::Mongoid
  elsif defined?(ActiveRecord::Base) && self.new.is_a?(ActiveRecord::Base)
    self.send :include, Orm::ActiveRecord
  end
  self.send :include, Validations
end