Module: Juixe::Acts::Commentable::InstanceMethods

Defined in:
lib/commentable_methods.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.



57
58
59
# File 'lib/commentable_methods.rb', line 57

def add_comment(comment)
  comments << comment
end

#comments_ordered_by_submittedObject

Helper method to sort comments by date



49
50
51
52
53
54
# File 'lib/commentable_methods.rb', line 49

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