Class: Spree::Products::Sort
- Inherits:
-
Object
- Object
- Spree::Products::Sort
- Defined in:
- app/sorters/spree/products/sort.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(scope, params, current_currency) ⇒ Sort
constructor
A new instance of Sort.
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
#call ⇒ Object
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 |