mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Support for a whitelist for embeddable host paths
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
class EmbeddableHostSerializer < ApplicationSerializer
|
||||
attributes :id, :host, :category_id
|
||||
|
||||
def id
|
||||
object.id
|
||||
TO_SERIALIZE = [:id, :host, :path_whitelist, :category_id]
|
||||
|
||||
attributes *TO_SERIALIZE
|
||||
|
||||
TO_SERIALIZE.each do |attr|
|
||||
define_method(attr) { object.send(attr) }
|
||||
end
|
||||
|
||||
def host
|
||||
object.host
|
||||
end
|
||||
|
||||
def category_id
|
||||
object.category_id
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user