This project is archived and is in readonly mode.

#1810 ✓stale
barunio

migrations load environment twice

Reported by barunio | January 28th, 2009 @ 09:35 PM | in 2.x

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.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages