Class: BeerDb::Stats

Inherits:
Object
  • Object
show all
Includes:
Models
Defined in:
lib/beerdb/stats.rb

Instance Method Summary collapse

Instance Method Details

#tablesObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/beerdb/stats.rb', line 8

def tables
  puts "Stats:"
  puts " #{'%5d' % Beer.count} beers"
  puts " #{'%5d' % Brand.count} brands"
  puts " #{'%5d' % Brewery.count} breweries"
  puts

  ### fix: use if defined? BeerDbNote or similar or/and check if table exist ??
  ###      or move to beerdb-note ??
  
  # puts " #{'%5d' % User.count} users"         # db model extension - move to its own addon?
  # puts " #{'%5d' % Bookmark.count} bookmarks" # db model extension - move to its own addon?
  # puts " #{'%5d' % Drink.count} drinks"       # db model extension - move to its own addon?
  # puts " #{'%5d' % Note.count} notes"         # db model extension - move to its own addon?
end