FEATURE: Support for a whitelist for embeddable host paths

This commit is contained in:
Robin Ward
2016-08-23 14:55:52 -04:00
parent 43a3210c20
commit c3a3aff120
12 changed files with 51 additions and 31 deletions

View File

@@ -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