luzmdiaz2013 / AlchemyByDesign

0 stars 0 forks source link

Seeding probs #1

Open luzmdiaz2013 opened 6 years ago

luzmdiaz2013 commented 6 years ago

Error message: not sure what it means rails aborted! NameError: undefined local variable or method t' for #<Class:0x007fb07d82b7b8> /Users/student_16/wdi/Projects/Alchemy/app/models/author_article.rb:2:in' /Users/student_16/wdi/Projects/Alchemy/app/models/author_article.rb:1:in <top (required)>' /Users/student_16/wdi/Projects/Alchemy/db/seeds.rb:18:in<top (required)>' /Users/student_16/wdi/Projects/Alchemy/bin/rails:9:in require' /Users/student_16/wdi/Projects/Alchemy/bin/rails:9:in<top (required)>' /Users/student_16/wdi/Projects/Alchemy/bin/spring:15:in <top (required)>' bin/rails:3:inload' bin/rails:3:in `

' Tasks: TOP => db:seed

3 - solutions rails c could not identify the tables tried to add to the db manually psql - author, article tables exist but are empty. edited the seed file and added the ArticleAuthor join table data

dominic-farquharson commented 6 years ago

You have a typo in one of your models.

class AuthorArticle < ApplicationRecord
  t.belongs_to :author
  t.belongs_to :article

end

It should just be:

class AuthorArticle < ApplicationRecord
  belongs_to :author
  belongs_to :article

end