Module: SpreeCmCommissioner::RouteOrderCountable

Defined in:
app/models/concerns/spree_cm_commissioner/route_order_countable.rb

Instance Method Summary collapse

Instance Method Details

#has_trip_ids?Boolean

rubocop:disable Naming/PredicateName

Returns:

  • (Boolean)


3
4
5
# File 'app/models/concerns/spree_cm_commissioner/route_order_countable.rb', line 3

def has_trip_ids? # rubocop:disable Naming/PredicateName
  preload_trip_ids.any?
end

#increment_route_fulfilled_order_countObject



7
8
9
10
11
# File 'app/models/concerns/spree_cm_commissioner/route_order_countable.rb', line 7

def increment_route_fulfilled_order_count
  return unless has_trip_ids?

  SpreeCmCommissioner::Transit::RouteFulfilledOrderCountIncrementerJob.perform_later(order_id: id)
end

#increment_route_order_countObject



13
14
15
16
17
# File 'app/models/concerns/spree_cm_commissioner/route_order_countable.rb', line 13

def increment_route_order_count
  return unless has_trip_ids?

  SpreeCmCommissioner::Transit::RouteOrderCountIncrementerJob.perform_later(order_id: id)
end