Class: Spree::Classifications::Sort

Inherits:
BaseSorter show all
Defined in:
app/sorters/spree/classifications/sort.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Sort.



4
5
6
7
8
# File 'app/sorters/spree/classifications/sort.rb', line 4

def initialize(scope, current_currency, params = {}, allowed_sort_attributes = [])
  super(scope.reorder(''), params, allowed_sort_attributes)

  @currency = params[:currency] || current_currency
end

Instance Method Details

#callObject



10
11
12
13
14
15
# File 'app/sorters/spree/classifications/sort.rb', line 10

def call
  classifications = by_manual(scope)
  classifications = by_best_selling(classifications)
  classifications = by_param_attributes(classifications)
  by_price(classifications)
end