mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
9 lines
238 B
Ruby
9 lines
238 B
Ruby
class Api::Admin::UnitsVariantSerializer < ActiveModel::Serializer
|
|
attributes :id, :full_name, :unit_value
|
|
|
|
def full_name
|
|
full_name = object.full_name
|
|
object.product.name + (full_name.empty? ? "" : ": #{full_name}")
|
|
end
|
|
end
|