Class: Spree::BaseSorter

Inherits:
Object
  • Object
show all
Defined in:
app/sorters/spree/base_sorter.rb

Direct Known Subclasses

Orders::Sort, Products::Sort

Instance Method Summary collapse

Constructor Details

#initialize(scope, params = {}, allowed_sort_attributes = []) ⇒ BaseSorter

Returns a new instance of BaseSorter.



3
4
5
6
7
# File 'app/sorters/spree/base_sorter.rb', line 3

def initialize(scope, params = {}, allowed_sort_attributes = [])
  @scope = scope
  @allowed_sort_attributes = allowed_sort_attributes
  @sort = sort_fields(params[:sort])
end

Instance Method Details

#callObject



9
10
11
# File 'app/sorters/spree/base_sorter.rb', line 9

def call
  by_param_attributes(scope)
end