mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Voucher adjustment, add ordering by created_at
It gives us a consistent result when calling #vouchers
This commit is contained in:
committed by
Maikel Linke
parent
a1ad25f217
commit
94294fa161
@@ -62,7 +62,11 @@ module Spree
|
||||
has_many :line_item_adjustments, through: :line_items, source: :adjustments
|
||||
has_many :shipment_adjustments, through: :shipments, source: :adjustments
|
||||
has_many :all_adjustments, class_name: 'Spree::Adjustment', dependent: :destroy
|
||||
has_many :vouchers, -> { where(originator_type: 'Voucher') },
|
||||
has_many :vouchers,
|
||||
-> {
|
||||
where(originator_type: 'Voucher')
|
||||
.order("#{Spree::Adjustment.table_name}.created_at ASC")
|
||||
},
|
||||
class_name: 'Spree::Adjustment',
|
||||
dependent: :destroy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user