This project is archived and is in readonly mode.
seeds.rb isn't executed within database resets run by tests
Reported by Nathan Beyer | September 28th, 2009 @ 06:47 PM
I've attempted to use the seeds.rb to setup some low-level data in the database, which my code depends upon. In this specific case, I'm setting up a reference data table that backs a model, then I'm using this model and the assumed content to perform a join in a named_scope query of another model.
My tests are failing to run, as the seed data isn't available, so when the model is loaded and the named_scope is evaluated, the reference data isn't available to fulfill the setup of the query.
Comments and changes to this ticket
-
Mike Riley July 29th, 2010 @ 03:01 PM
- State changed from new to resolved
- Importance changed from to
Hello Nathan,
Not sure if you saw the following information:
http://railscasts.com/episodes/179-seed-data
http://www.robbyonrails.com/articles/2009/09/05/planting-the-seeds
http://ryandaigle.com/articles/2009/5/13/what-s-new-in-edge-rails-d...
http://railsforum.com/viewtopic.php?id=38748Did you have any errors when you run rake db:seed? Due to how old this ticket is, I am going to mark this issue as resolved. However, if you need more help on this feel free to update it so we can help.
Mike Riley
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>