Class: Effective::Datatables::Orders
- Inherits:
-
Effective::Datatable
- Object
- Effective::Datatable
- Effective::Datatables::Orders
- Defined in:
- app/models/effective/datatables/orders.rb
Instance Method Summary collapse
Instance Method Details
#collection ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'app/models/effective/datatables/orders.rb', line 67 def collection collection = Effective::Order.unscoped .joins(:user) .includes(:addresses) .includes(:user) .includes(:order_items) if EffectiveOrders.orders_collection_scope.respond_to?(:call) collection = EffectiveOrders.orders_collection_scope.call(collection) end attributes[:user_id].present? ? collection.where(user_id: attributes[:user_id]) : collection end |
#purchase_state_filter_values ⇒ Object
81 82 83 84 85 86 87 88 |
# File 'app/models/effective/datatables/orders.rb', line 81 def purchase_state_filter_values [ %w(abandoned nil), [EffectiveOrders::PURCHASED, EffectiveOrders::PURCHASED], [EffectiveOrders::DECLINED, EffectiveOrders::DECLINED], [EffectiveOrders::PENDING, EffectiveOrders::PENDING] ] end |