mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
22 lines
423 B
Ruby
22 lines
423 B
Ruby
|
class VersionSerializer < ApplicationSerializer
|
||
|
|
||
|
attributes :number, :display_username, :created_at, :description
|
||
|
|
||
|
def number
|
||
|
object[:number]
|
||
|
end
|
||
|
|
||
|
def display_username
|
||
|
object[:display_username]
|
||
|
end
|
||
|
|
||
|
def created_at
|
||
|
object[:created_at]
|
||
|
end
|
||
|
|
||
|
def description
|
||
|
"v#{object[:number]} - #{FreedomPatches::Rails4.time_ago_in_words(object[:created_at])} ago by #{object[:display_username]}"
|
||
|
end
|
||
|
|
||
|
end
|