mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-07 22:46:06 +00:00
10 lines
321 B
Ruby
10 lines
321 B
Ruby
class Api::Admin::ExchangeSerializer < ActiveModel::Serializer
|
|
attributes :id, :sender_id, :receiver_id, :incoming, :variants, :pickup_time, :pickup_instructions
|
|
|
|
has_many :enterprise_fees, serializer: Api::Admin::EnterpriseFeeSerializer
|
|
|
|
def variants
|
|
Hash[ object.variants.map { |v| [v.id, true] } ]
|
|
end
|
|
end
|