Class: SolidusBactracs::Shipment::BetweenQuery

Inherits:
Object
  • Object
show all
Defined in:
app/queries/solidus_bactracs/shipment/between_query.rb

Class Method Summary collapse

Class Method Details

.apply(scope, from:, to:) ⇒ Object



6
7
8
9
10
11
# File 'app/queries/solidus_bactracs/shipment/between_query.rb', line 6

def self.apply(scope, from:, to:)
  scope.joins(:order).where(<<~SQL.squish, from: from, to: to)
    (spree_shipments.updated_at > :from AND spree_shipments.updated_at < :to) OR
    (spree_orders.updated_at > :from AND spree_orders.updated_at < :to)
  SQL
end