brady8/thumbs_up — Issue #23: Using plusminus_tally in a scope make db:migrate crash
Author: jerefrer
Created: 2011-11-18 12:55:33+00:00
State: open

First thank you for your plugin, it's awesome ;)
And keep maintaining it ! (I could help)

Sooo I stumbled upon this issue when trying to reinstall my app on another server :

I have a scope in my user.rb model :

scope :best, plusminus_tally.reorder("vote_total DESC")

which throws an error saying that "table users does not exist"

I added a :

unless File.basename($0) == 'rake' .... end

around it so everything is now working just fine.

But maybe it could be avoided ? I'm not quite comfortable with those Rails internals yet so I couldn't tell.

Cheers !