mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-11 00:02:05 -05:00
30 lines
587 B
Ruby
30 lines
587 B
Ruby
class InvitedUserSerializer < BasicUserSerializer
|
|
|
|
attributes :topics_entered,
|
|
:posts_read_count,
|
|
:last_seen_at,
|
|
:time_read,
|
|
:days_visited,
|
|
:days_since_created
|
|
|
|
def time_read
|
|
AgeWords.age_words(object.user_stat.time_read)
|
|
end
|
|
|
|
def days_visited
|
|
object.user_stat.days_visited
|
|
end
|
|
|
|
def topics_entered
|
|
object.user_stat.topics_entered
|
|
end
|
|
|
|
def posts_read_count
|
|
object.user_stat.posts_read_count
|
|
end
|
|
|
|
def days_since_created
|
|
((Time.now - object.created_at) / 60 / 60 / 24).ceil
|
|
end
|
|
|
|
end
|