mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 04:33:37 +08:00
15 lines
362 B
Ruby
15 lines
362 B
Ruby
class EmbeddingSerializer < ApplicationSerializer
|
|
attributes :id, :fields, :base_url
|
|
attributes *Embedding.settings
|
|
|
|
has_many :embeddable_hosts, serializer: EmbeddableHostSerializer, embed: :ids
|
|
|
|
def fields
|
|
Embedding.settings
|
|
end
|
|
|
|
def read_attribute_for_serialization(attr)
|
|
object.respond_to?(attr) ? object.send(attr) : send(attr)
|
|
end
|
|
end
|