mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
22 lines
430 B
Ruby
22 lines
430 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Wrapper for a hash of issues encountered by instances of OrderSyncer and LineItemSyncer
|
|
# Used to report issues to the user when they attempt to update a subscription
|
|
|
|
class OrderUpdateIssues
|
|
def initialize
|
|
@issues = {}
|
|
end
|
|
|
|
delegate :[], :keys, to: :issues
|
|
|
|
def add(order, issue)
|
|
@issues[order.id] ||= []
|
|
@issues[order.id] << issue
|
|
end
|
|
|
|
private
|
|
|
|
attr_reader :issues
|
|
end
|