diff options
author | Uģis Ozols <ugis.ozolss@gmail.com> | 2010-12-03 11:31:21 +0200 |
---|---|---|
committer | Uģis Ozols <ugis.ozolss@gmail.com> | 2010-12-03 11:31:21 +0200 |
commit | 0dc56cc0173df7df09a8d7a8ad01373d3dc81cd2 (patch) | |
tree | 5b02e6fcd2bb6a78336f4426dd744f156e8d4883 /app | |
parent | 1d7a814fb1a2e7725bc142dfbf9501cfd909c781 (diff) | |
download | refinerycms-blog-0dc56cc0173df7df09a8d7a8ad01373d3dc81cd2.tar.gz refinerycms-blog-0dc56cc0173df7df09a8d7a8ad01373d3dc81cd2.tar.bz2 refinerycms-blog-0dc56cc0173df7df09a8d7a8ad01373d3dc81cd2.zip |
When we delete blog post it should delete associated comments too.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/blog_post.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/blog_post.rb b/app/models/blog_post.rb index f2a1465..ccd10e2 100644 --- a/app/models/blog_post.rb +++ b/app/models/blog_post.rb @@ -1,6 +1,6 @@ class BlogPost < ActiveRecord::Base - has_many :comments, :class_name => 'BlogComment' + has_many :comments, :class_name => 'BlogComment', :dependent => :destroy has_and_belongs_to_many :categories, :class_name => 'BlogCategory' acts_as_indexed :fields => [:title, :body] |