From e747759b0b65e1b719b6b2a5858431cf208b6d0f Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Sat, 21 Mar 2009 22:13:31 -0500 Subject: [PATCH] comments are dependent on the page --- app/models/page.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/page.rb b/app/models/page.rb index 144821f..0d13249 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -2,7 +2,7 @@ class Page < ActiveRecord::Base validates_format_of :name, :with => /^[\w ]+$/ validates_uniqueness_of :name - has_many :comments, :order => 'created_at ASC' + has_many :comments, :order => 'created_at ASC', :dependent => :destroy has_and_belongs_to_many :tags, :order => 'tags.name ASC' belongs_to :author attr_protected :author_id