开发者

Rake db:migrate uninitialized constant

开发者 https://www.devze.com 2022-12-09 16:03 出处:网络
In order to run rake db:migrate I need both my models and constants defined in application controller.

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.


Migrations don't load application controller.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消