Class: WorldDB::Stats

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

Overview

method delete!

Instance Method Summary collapse

Instance Method Details

#propsObject



226
227
228
229
230
231
# File 'lib/worlddb.rb', line 226

def props
  puts "Props:"
  Prop.order( 'created_at asc' ).all.each do |prop|
    puts "  #{prop.key} / #{prop.value} || #{prop.created_at}"
  end
end

#tablesObject



215
216
217
218
219
220
221
222
223
224
# File 'lib/worlddb.rb', line 215

def tables
  puts "Stats:"
  puts " #{'%5d' % Country.count} countries (#{Country.where(s: true).count} supras, #{Country.where(d:true).count} deps)"
  puts " #{'%5d' % Region.count} regions"
  puts " #{'%5d' % City.where(m: true).where(c: false).count} metros"
  puts " #{'%5d' % City.where(c: true).count} cities (#{City.where(c: true).where(m: true).count} metros)"
  puts " #{'%5d' % City.where(d: true).count} districts"
  puts " #{'%5d' % Tag.count} tags"
  puts " #{'%5d' % Tagging.count} taggings"
end