Ruby on Rails Sunday, June 11, 2017

On Sat, Jun 10, 2017 at 6:50 PM, fugee ohu <fugee279@gmail.com> wrote:

> ... so I took out the Profile model

What does "took out" mean? What exactly did you do? Is it the
exact reverse of how you created that model to start with?

> ActiveRecord::InvalidForeignKey (Mysql2::Error: Cannot add or update a child
> row: a foreign key constraint fails (`socialnetworking_development`.`posts`,
> CONSTRAINT `fk_rails_cd61a4aa45` FOREIGN KEY (`user_id`) REFERENCES
> `profiles` (`id`)):

Given that you're seeing a *database-generated* error -- have you
looked at the relationships, i.e. foreign keys, in the referenced tables
in that database?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yD%3DEiUEO%3D%2B%3DtwA6a1RiTGdEWR7oZQMWX5ozepSQx%3D_rvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment