2015-08-18 17:15:46 -04:00
|
|
|
class EmbeddingSerializer < ApplicationSerializer
|
2015-08-20 13:43:12 -04:00
|
|
|
attributes :id, :fields, :base_url
|
|
|
|
attributes *Embedding.settings
|
|
|
|
|
2015-08-18 17:15:46 -04:00
|
|
|
has_many :embeddable_hosts, serializer: EmbeddableHostSerializer, embed: :ids
|
|
|
|
|
2015-08-20 13:43:12 -04:00
|
|
|
def fields
|
|
|
|
Embedding.settings
|
|
|
|
end
|
|
|
|
|
|
|
|
def read_attribute_for_serialization(attr)
|
|
|
|
object.respond_to?(attr) ? object.send(attr) : send(attr)
|
2015-08-18 17:15:46 -04:00
|
|
|
end
|
|
|
|
end
|