Module: Quickening::Model::ClassMethods

Defined in:
lib/quickening/model.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#find_duplicates_for(item) ⇒ Object

Looks for other records in the same table for items matching on all pre-defined columns. This has little benefit of usage except to act as a proxy for the instance-level methods, such as #duplicates.

User.find_duplicates_for(user)
# => [#<User id: 2 ..>]


111
112
113
114
# File 'lib/quickening/model.rb', line 111

def find_duplicates_for(item)
  where(item._duplicate_conditions).
  where("`#{table_name}`.`id` != ?", item.id)
end