discourse/app/serializers/embedding_serializer.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
407 B
Ruby
Raw Normal View History

# frozen_string_literal: true
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)
2019-05-06 21:27:05 -04:00
object.respond_to?(attr) ? object.public_send(attr) : public_send(attr)
end
end