mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
32 lines
No EOL
460 B
Ruby
32 lines
No EOL
460 B
Ruby
class TopicLinkSerializer < ApplicationSerializer
|
|
|
|
attributes :url, :title, :internal, :reflection, :clicks, :user_id
|
|
|
|
def url
|
|
object['url']
|
|
end
|
|
|
|
def title
|
|
object['title']
|
|
end
|
|
|
|
def internal
|
|
object['internal'] == 't'
|
|
end
|
|
|
|
def reflection
|
|
object['reflection'] == 't'
|
|
end
|
|
|
|
def clicks
|
|
object['clicks'] || 0
|
|
end
|
|
|
|
def user_id
|
|
object['user_id'].to_i
|
|
end
|
|
def include_user_id?
|
|
object['user_id'].present?
|
|
end
|
|
|
|
end |