Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Replaced :dependent=>destroy in commentable model for before_destroy …

…filter affecting only root_comments
  • Loading branch information...
commit 31ab6eecd4eae6192400362a49ab79e417790f82 1 parent 80e4934
Xavier Redó authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/acts_as_commentable_with_threading.rb
View
3  lib/acts_as_commentable_with_threading.rb
@@ -16,7 +16,8 @@ module CommentableWithThreading #:nodoc:
module ClassMethods
def acts_as_commentable
- has_many :comment_threads, :class_name => "Comment", :as => :commentable, :dependent => :destroy
+ has_many :comment_threads, :class_name => "Comment", :as => :commentable
+ before_destroy { |record| record.root_comments.destroy_all }
include Acts::CommentableWithThreading::LocalInstanceMethods
extend Acts::CommentableWithThreading::SingletonMethods
end
Please sign in to comment.
Something went wrong with that request. Please try again.