Files
openfoodnetwork/app/serializers/api/variant_serializer.rb
2014-07-18 11:21:51 +10:00

11 lines
308 B
Ruby

class Api::VariantSerializer < ActiveModel::Serializer
attributes :id, :is_master, :count_on_hand, :name_to_display, :on_demand,
:price
has_many :images, serializer: Api::ImageSerializer
def price
object.price_with_fees(options[:current_distributor], options[:current_order_cycle])
end
end