Module: Dedupe::Orm::ActiveRecord
Instance Method Summary collapse
Instance Method Details
#duplicate? ⇒ Boolean
21 22 23 |
# File 'lib/dedupe/orm/active_record.rb', line 21 def duplicate? self.duplicates.present? end |
#duplicates ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/dedupe/orm/active_record.rb', line 13 def duplicates klass, scope_name = self.class, self.class.dedupe_scope_name raise MissingScope unless klass.respond_to? scope_name result_set = klass.send scope_name, self raise InvalidScope unless result_set.is_a? ::ActiveRecord::Relation result_set.excluding self end |