I am new to Rails and running into problems loading fixtures. After
generating a bunch of scaffolding, I did a "rake db:migrate", followed
by "rake db:test:load", and then "rake db:fixtures:load". My goal is
to run the unit tests so that I can verify that everything is at a
good starting point before I do any real development. I get the
SQLite3::SQLException: table caches has no column named structure:
INSERT INTO "
caches" ("structure", "capacity") VALUES (NULL, 1)
Can somebody provide a good starting point for troubleshooting this
type of problem?
After a bit of searching, I think these are the three relevant code
snippets that I should be looking at.
class Cache < ActiveRecord::Base
create_table "caches", :force => true do |t|
All of this was generated for me, and it all matches up with what I
expect from documentation. I know if "belongs_to :structure" was
missing from my model I should expect the error I'm seeing now, so I'm
very suspicious of that being wrong in a subtle way.
Here's the model for structure if it matters (as far as I can tell, it
class Structure < ActiveRecord::Base