Permalink
Browse files

[FIX] Use `MyModel.count`, not `MyModel.all.count` in the Rake import…

… task

Previously, all records had to be loaded into memory (errr),
better to use the `Model.count` method

Closes #471
  • Loading branch information...
1 parent 5886c6e commit 879a0486fc84d5e4afd8dc96e2dd0da00cd86a00 @alan alan committed with 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 879a048

Please sign in to comment.