mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
13 lines
342 B
Ruby
13 lines
342 B
Ruby
class Api::Admin::VariantOverrideSerializer < ActiveModel::Serializer
|
|
attributes :id, :hub_id, :variant_id, :sku, :price, :count_on_hand, :on_demand, :default_stock, :resettable
|
|
attributes :tag_list, :tags, :import_date
|
|
|
|
def tag_list
|
|
object.tag_list.join(",")
|
|
end
|
|
|
|
def tags
|
|
object.tag_list.map { |t| { text: t } }
|
|
end
|
|
end
|