Class: Validb::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/validb/counter.rb

Instance Method Summary collapse

Constructor Details

#initialize(model_names) ⇒ Counter

Returns a new instance of Counter.



3
4
5
# File 'lib/validb/counter.rb', line 3

def initialize(model_names)
  @models = model_names.map(&:constantize)
end

Instance Method Details

#countObject



7
8
9
10
11
12
# File 'lib/validb/counter.rb', line 7

def count
  $stdout.puts("\nChecking models:")
  @models.each do |model|
    $stdout.puts("#{model}(#{model.table_name}) (#{model.count} records)")
  end
end