Module: Workarea::DiscountIds

Extended by:
ActiveSupport::Concern
Included in:
Order, Shipping
Defined in:
app/models/workarea/discount_ids.rb

Overview

This mixin includes 2 responsibilities:

  • Provide logic to aggregate discount IDs from price adjustments

  • Persist to the database for querying later

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#discount_idsObject



21
22
23
24
25
26
# File 'app/models/workarea/discount_ids.rb', line 21

def discount_ids
  price_adjustments
    .map { |pa| pa.data['discount_id'] }
    .compact
    .uniq
end