Sha256: 96824f316f2cf119b7bb5e75de71c1c3328dc585da63cce7e96b484db33463f2
Contents?: true
Size: 517 Bytes
Versions: 9
Compression:
Stored size: 517 Bytes
Contents
module Alchemy class ContentSerializer < ActiveModel::Serializer self.root = false attributes :id, :name, :ingredient, :element_id, :position, :created_at, :updated_at has_one :essence, polymorphic: true def ingredient case object.essence_type when 'Alchemy::EssencePicture' object.essence.picture_url when 'Alchemy::EssenceFile' object.essence.attachment_url else object.ingredient end end end end
Version data entries
9 entries across 9 versions & 1 rubygems