1 class ActiveRecord::Base
2 module CommentingExtensions
9 def comment_with(attributes)
12 comment = Comment.create(attributes)
13 raise Comment::Error, "Comment could not be saved with" if comment.new_record?
14 comment.commentables << self
20 def commentable?(should_raise = false) #:nodoc:
21 unless flag = respond_to?(:<%= parent_association_name -%>s)
22 raise "#{self.class} is not a commentable model" if should_raise
28 include CommentingExtensions