Permalink
Browse files

Count records in SQL, avoids loading all the records into memory

  • Loading branch information...
1 parent 9412ef0 commit be2d83431010261080ce816be4f0a5e17fda7f9f @alan committed Oct 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tire/tasks.rb
View
@@ -60,7 +60,7 @@ def elapsed_to_human(elapsed)
STDOUT.sync = true
puts "[IMPORT] Starting import for the '#{ENV['CLASS']}' class"
tty_cols = 80
- total = klass.all.count rescue nil
+ total = klass.count rescue nil
offset = (total.to_s.size*2)+8
done = 0

0 comments on commit be2d834

Please sign in to comment.