Module: Acts::CommentableWithThreading::InstanceMethods

Defined in:
lib/acts_as_commentable_with_threading.rb

Overview

This module contains instance methods

Instance Method Summary collapse

Instance Method Details

#add_comment(comment) ⇒ Object

Helper method that defaults the submitted time.



61
62
63
# File 'lib/acts_as_commentable_with_threading.rb', line 61

def add_comment(comment)
  comments << comment
end

#comments_ordered_by_submittedObject

Helper method to sort comments by date



53
54
55
56
57
58
# File 'lib/acts_as_commentable_with_threading.rb', line 53

def 
  Comment.find(:all,
    :conditions => ["commentable_id = ? and commentable_type = ?", id, self.type.name],
    :order => "created_at DESC"
  )
end