mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-09 23:06:06 +00:00
9 lines
250 B
Ruby
9 lines
250 B
Ruby
class Api::Admin::UnitsVariantSerializer < ActiveModel::Serializer
|
|
attributes :id, :unit_text, :unit_value
|
|
|
|
def unit_text
|
|
options_text = object.options_text
|
|
object.product.name + (options_text.empty? ? "" : ": #{options_text}")
|
|
end
|
|
end
|