Class: Spree::Products::Sort

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

Instance Method Summary collapse

Constructor Details

#initialize(scope, params, current_currency) ⇒ Sort

Returns a new instance of Sort.



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

def initialize(scope, params, current_currency)
  @scope    = scope
  @sort     = params[:sort]
  @currency = params[:currency] || current_currency
end

Instance Method Details

#callObject



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

def call
  products = updated_at(scope)
  products = price(products)

  products
end