I just ran rake on a development site on a server, which I typically
don’t do, while trying to test what I thought to be a server-related
issue. When rake finished (all tests passed) the production database
was wiped, leaving only fixture data. I subsequently noticed that in
the dev site’s ‘environment.rb’ I had uncommented the line…
ENV[‘RAILS_ENV’] = ‘production’
The site_test database was unchanged. I believe the database.yml file
is configured correctly (test environment points to my _test
It’s a tad disconcerting that typing “rake” in the wrong directory
could have that sort of effect. Shouldn’t rake always target the
test environment database, regardless of environment rails is running?
Or perhaps I just don’t understand something.
Fusionary Media - http://www.fusionary.com