lib/commentable_on/comment.rb in commentable_on-0.1.0 vs lib/commentable_on/comment.rb in commentable_on-1.0.0
- old
+ new
@@ -1,6 +1,10 @@
+require "ancestry"
+
module CommentableOn
class Comment < ::ActiveRecord::Base
+ has_ancestry(primary_key_format: /\A[\w\-]+(\/[\w\-]+)*\z/, ancestry_column: :thread)
+
if defined?(ProtectedAttributes)
attr_accessible :commentable_id, :commentable_type, :commenter_id, :commenter_type, :commentable, :commenter, :body
end
belongs_to :commentable, polymorphic: true