Class: Workarea::Search::AdminLegacyOrders

Inherits:
Object
  • Object
show all
Includes:
AdminIndexSearch, AdminSorting, Pagination, Query
Defined in:
app/queries/workarea/search/admin_legacy_orders.rb

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ AdminLegacyOrders

Returns a new instance of AdminLegacyOrders.



11
12
13
# File 'app/queries/workarea/search/admin_legacy_orders.rb', line 11

def initialize(params = {})
  super(params.merge(type: 'legacy_order'))
end

Instance Method Details

#current_sortObject



28
29
30
# File 'app/queries/workarea/search/admin_legacy_orders.rb', line 28

def current_sort
  AdminOrders.available_sorts.find(params[:sort])
end

#facetsObject



15
16
17
# File 'app/queries/workarea/search/admin_legacy_orders.rb', line 15

def facets
  super + [TermsFacet.new(self, 'order_status')]
end

#filtersObject



19
20
21
22
23
24
25
26
# File 'app/queries/workarea/search/admin_legacy_orders.rb', line 19

def filters
  [
    DateFilter.new(self, 'placed_at', :gte),
    DateFilter.new(self, 'placed_at', :lte),
    RangeFilter.new(self, 'total_price', :gte),
    RangeFilter.new(self, 'total_price', :lt)
  ]
end