Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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...
commit 027ad536e50c235c188bfab96f719cf116b53394 1 parent bc302eb
Alan Kennedy alan authored committed

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  lib/tire/tasks.rb
2  lib/tire/tasks.rb
@@ -60,7 +60,7 @@ def elapsed_to_human(elapsed)
60 60 STDOUT.sync = true
61 61 puts "[IMPORT] Starting import for the '#{ENV['CLASS']}' class"
62 62 tty_cols = 80
63   - total = klass.all.count rescue nil
  63 + total = klass.count rescue nil
64 64 offset = (total.to_s.size*2)+8
65 65 done = 0
66 66

0 comments on commit 027ad53

Please sign in to comment.
Something went wrong with that request. Please try again.