I set up the Many to Many a couple days ago and came back to the part where we add seed data to test. I added this:
superman = Hero.find_or_create_by(name: 'Superman')
drmanhattan = Hero.find_or_create_by(name: 'Dr. Manhattan')
Team.find_or_create_by(name: "The Watchmen", hero: drmanhattan)
Team.find_or_create_by(name: "Doomnday Clock", hero: drmanhattan)
drmanhattan.teams.find_or_create_by(name:"Team 1")
drmanhattan.teams.find_or_create_by(name:"Team 2")
drmanhattan.teams.find_or_create_by(name:"Team 3")
here’s the error I get:
Caused by:
SQLite3::SQLException: no such column: heros.name
/Users/ryan/.rvm/gems/ruby-2.6.1/gems/sqlite3-
whats strange is I see
:name
-
in the schema for heros
t.string :name
- in the create_heros.rb file.
Since everything seems to be here..I'm not clear on what is happening.
Here is my repo https://github.com/planetlucid/Ruby_On_Rails_Project
Thanks in advance for your help.