mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
12 lines
420 B
Ruby
12 lines
420 B
Ruby
class Api::VariantSerializer < ActiveModel::Serializer
|
|
attributes :id, :is_master, :count_on_hand, :name_to_display, :on_demand,
|
|
:price
|
|
attributes :id, :is_master, :count_on_hand, :name_to_display, :unit_to_display, :on_demand
|
|
attributes :price
|
|
has_many :images, serializer: Api::ImageSerializer
|
|
|
|
def price
|
|
object.price_with_fees(options[:current_distributor], options[:current_order_cycle])
|
|
end
|
|
end
|