mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
26 lines
472 B
Ruby
26 lines
472 B
Ruby
|
class SiteContentSerializer < ApplicationSerializer
|
||
|
|
||
|
attributes :content_type,
|
||
|
:title,
|
||
|
:description,
|
||
|
:content,
|
||
|
:format
|
||
|
|
||
|
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
|
||
|
end
|