Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

migrations load environment twice

#1810

I've noticed that running rake:db:migrate loads the environment.rb file twice. I'm not sure if this has always been the case, or if this is intentional, but it does cause problems in certain cases.

For example, I recently started using the validates_timeliness plugin and issued a command: >> ValidatesTimeliness::Formats.remove_formats(:date, 'yyyy/mm/dd') which causes an exception to be thrown the second time the command is called, because you can't delete the same format twice.

In this particular example I can easily work around the issue so it isn't a huge deal. But, there may be other cases where workarounds aren't so easy, and I'm guessing that reloading the environment makes the migrations significantly slower as well.

Reported by barunio · January 28th, 2009 @ 09:35 PM

State: stale
Milestone: 2.x
Assigned to: nobody
Importance: none