aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2010-12-03 11:31:21 +0200
committerUģis Ozols <ugis.ozolss@gmail.com>2010-12-03 11:31:21 +0200
commit0dc56cc0173df7df09a8d7a8ad01373d3dc81cd2 (patch)
tree5b02e6fcd2bb6a78336f4426dd744f156e8d4883 /app
parent1d7a814fb1a2e7725bc142dfbf9501cfd909c781 (diff)
downloadrefinerycms-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.rb2
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]