dependent: :destroy

This commit is contained in:
nilsding 2014-12-28 21:42:21 +01:00
parent 9c9c4fdc5d
commit 7d157cde8f
1 changed files with 1 additions and 1 deletions

View File

@ -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 }