2013-04-04 12:59:44 -04:00
|
|
|
class SiteContentSerializer < ApplicationSerializer
|
|
|
|
|
|
|
|
attributes :content_type,
|
|
|
|
:title,
|
|
|
|
:description,
|
|
|
|
:content,
|
2013-06-26 10:57:35 -04:00
|
|
|
:format,
|
|
|
|
:allow_blank?
|
2013-04-04 12:59:44 -04:00
|
|
|
|
|
|
|
def title
|
|
|
|
object.site_content_type.title
|
|
|
|
end
|
|
|
|
|
|
|
|
def description
|
|
|
|
object.site_content_type.description
|
|
|
|
end
|
|
|
|
|
|
|
|
def format
|
|
|
|
object.site_content_type.format
|
|
|
|
end
|
|
|
|
|
|
|
|
def content
|
|
|
|
return object.content if object.content.present?
|
|
|
|
object.site_content_type.default_content
|
|
|
|
end
|
2013-06-26 10:57:35 -04:00
|
|
|
|
|
|
|
def allow_blank?
|
|
|
|
object.site_content_type.allow_blank?
|
|
|
|
end
|
2013-04-04 12:59:44 -04:00
|
|
|
end
|