From 7d157cde8f62368c716278fcdaa7b4403bcb10cb Mon Sep 17 00:00:00 2001 From: nilsding Date: Sun, 28 Dec 2014 21:42:21 +0100 Subject: [PATCH] dependent: :destroy --- app/models/question.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/question.rb b/app/models/question.rb index aed4ec91..53aeb9d9 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -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 }