dependent: :destroy
This commit is contained in:
parent
9c9c4fdc5d
commit
7d157cde8f
|
@ -1,6 +1,6 @@
|
|||
class Question < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
has_many :answers
|
||||
has_many :answers, dependent: :destroy
|
||||
has_many :inboxes, dependent: :destroy
|
||||
|
||||
validates :content, length: { maximum: 255 }
|
||||
|
|
Loading…
Reference in New Issue