views:

570

answers:

1

In order to run rake db:migrate I need both my models and constants defined in application controller.

When I run it I get this

rake aborted! An error has occurred, all later migrations canceled:

uninitialized constant Secondsperday

All I need is rake to load the environment. It used to do this...

Secondsperday is not a model, its this line in application controller.rb

Secondsperday = 24 * 3_600

Please help, I've been stuck for a week.

+2  A: 

Migrations don't load application controller.

If you want application-wide constants define them in a file placed in $RAILS_ROOT/config/initializers

EmFi
seriously, didn't they used to?
Not as far as I know.
EmFi
Also, I need my models - I need the whole environment, really.
Damn - it seems to be working - thanks VERY much guys!