mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-25 01:23:23 +00:00
20 lines
401 B
Ruby
20 lines
401 B
Ruby
# 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 standing order
|
|
|
|
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
|