Class: Calagator::DuplicateChecking::DuplicateFinder

Inherits:
Struct
  • Object
show all
Defined in:
lib/calagator/duplicate_checking/duplicate_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fieldsObject

Returns the value of attribute fields

Returns:

  • (Object)

    the current value of fields



4
5
6
# File 'lib/calagator/duplicate_checking/duplicate_finder.rb', line 4

def fields
  @fields
end

#modelObject

Returns the value of attribute model

Returns:

  • (Object)

    the current value of model



4
5
6
# File 'lib/calagator/duplicate_checking/duplicate_finder.rb', line 4

def model
  @model
end

Instance Method Details

#findObject



5
6
7
8
9
10
# File 'lib/calagator/duplicate_checking/duplicate_finder.rb', line 5

def find
  scope = model.all
  scope = yield(scope) if block_given?
  scope = apply_query(scope) unless na?
  group_by_fields(scope.to_a)
end