mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 21:16:08 +08:00
9 lines
283 B
Ruby
9 lines
283 B
Ruby
class LeaderRequirementsSerializer < ApplicationSerializer
|
|
attributes :time_period, :days_visited, :days_visited_percent,
|
|
:num_topics_with_replies, :num_topics_replied_to, :num_flagged_posts
|
|
|
|
def days_visited_percent
|
|
(days_visited * 100) / time_period
|
|
end
|
|
end
|