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



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

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

#posts_countObject



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

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

#topics_countObject



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

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