:dependent => :destroy for Asciicast#comments

This commit is contained in:
Marcin Kulik 2012-03-04 21:55:45 +01:00
parent ad9542d124
commit 44d6914991

View File

@ -8,7 +8,7 @@ class Asciicast < ActiveRecord::Base
validates :terminal_columns, :terminal_lines, :duration, :presence => true
belongs_to :user
has_many :comments, :order => :created_at
has_many :comments, :order => :created_at, :dependent => :destroy
before_create :assign_user, :unless => :user