Class: Thredded::Stats

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::NumberHelper
Defined in:
app/models/thredded/stats.rb

Instance Method Summary collapse

Instance Method Details

#messageboards_countObject



7
8
9
# File 'app/models/thredded/stats.rb', line 7

def messageboards_count
  number_to_human(messageboards.count, precision: 4)
end

#posts_countObject



15
16
17
# File 'app/models/thredded/stats.rb', line 15

def posts_count
  number_to_human(messageboards.map(&:posts_count).sum, precision: 5)
end

#topics_countObject



11
12
13
# File 'app/models/thredded/stats.rb', line 11

def topics_count
  number_to_human(messageboards.map(&:topics_count).sum, precision: 4)
end