Sha256: 669b0ab6331e502dff3bd344936aaf45524901c20611ddc26fdc9855eda52865

Contents?: true

Size: 409 Bytes

Versions: 15

Compression:

Stored size: 409 Bytes

Contents

# frozen_string_literal: true

module SolidusBactracs
  module Shipment
    class BetweenQuery
      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
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
solidus_bactracs-4.0.1 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-4.0.0 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.5.2 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.5.1 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.5.0 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.4.0 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.3.2 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.3.1 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.3.0 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.2.2 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.2.1 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.2.0 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.1.2 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.1.1 app/queries/solidus_bactracs/shipment/between_query.rb
solidus_bactracs-3.1.0 app/queries/solidus_bactracs/shipment/between_query.rb