When you invoke Rake, you can pass the --trace
flag to it. This should give you a backtrace, which I suspect is going to tell you the error is on the line not_flag = all_Active_Games > 0
, because all_Active_Games
is an ActiveRecord relation, but you're trying to compare it to the integer 0. Bascially, you have a type error. In a static language, this wouldn't even compile.
It would also be good to also fix your indentation, choose more descriptive variable names (x
-> game
)