Class: Spree::Posts::Sort
- Inherits:
-
BaseSorter
- Object
- BaseSorter
- Spree::Posts::Sort
- Defined in:
- app/sorters/spree/posts/sort.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(scope, params = {}, allowed_sort_attributes = []) ⇒ Sort
constructor
A new instance of Sort.
Constructor Details
#initialize(scope, params = {}, allowed_sort_attributes = []) ⇒ Sort
Returns a new instance of Sort.
4 5 6 |
# File 'app/sorters/spree/posts/sort.rb', line 4 def initialize(scope, params = {}, allowed_sort_attributes = []) super(scope, params, allowed_sort_attributes) end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 |
# File 'app/sorters/spree/posts/sort.rb', line 8 def call posts = by_param_attributes(scope) posts = select_translatable_fields(posts) if Spree.use_translations? posts.distinct end |