Yeng Tsan

Joined

2,410 Experience
24 Lessons Completed
0 Questions Solved

Activity

If someone is using Rails 5, notice that "the relational model MUST need the foreign key to create the instance", because the forum_thread has not created yet, the foreign key in forum_post is missing.

In Rails 5, need to add ', optional: true' to forum_post.rb

'belongs_to :forum_thread' >>> 'belongs_to :forum_thread, optional: true'