mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
16 lines
443 B
Ruby
16 lines
443 B
Ruby
module Api
|
|
module Admin
|
|
# Used by admin subscription form
|
|
# Searches for a ship and bill addresses for the customer
|
|
# where they are not already explicitly set
|
|
class SubscriptionCustomerSerializer < CustomerSerializer
|
|
delegate :bill_address, to: :finder
|
|
delegate :ship_address, to: :finder
|
|
|
|
def finder
|
|
@finder ||= OpenFoodNetwork::AddressFinder.new(object, object.email)
|
|
end
|
|
end
|
|
end
|
|
end
|