mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
16 lines
376 B
Ruby
16 lines
376 B
Ruby
module Api
|
|
module Admin
|
|
class SubscriptionLineItemSerializer < ActiveModel::Serializer
|
|
attributes :id, :variant_id, :quantity, :description, :price_estimate
|
|
|
|
def description
|
|
"#{object.variant.product.name} - #{object.variant.full_name}"
|
|
end
|
|
|
|
def price_estimate
|
|
object.price_estimate.andand.to_f || "?"
|
|
end
|
|
end
|
|
end
|
|
end
|