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.

seeds.rb isn't executed within database resets run by tests

#3297

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.

Reported by Nathan Beyer · September 28th, 2009 @ 06:47 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Mike Riley
    Mike Riley
    • 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=38748

    Did 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

    July 29th, 2010 @ 03:01 PM