ActiveRecord::RecordInvalid:Validation failed
No matter where you check the model or the migration file There is no validation setting.
However, the error that keeps appearing.
It seems that the change from Rails 5 has set the validation of existence in belongs_to.
belongs_to :post_id, optional: true
https://railsguides.jp/association_basics.html
https://teratail.com/questions/65278
Recommended Posts