Module: Juixe::Acts::Commentable::InstanceMethods
- Defined in:
- lib/commentable_methods.rb
Overview
This module contains instance methods
Instance Method Summary collapse
-
#add_comment(comment) ⇒ Object
Helper method that defaults the submitted time.
-
#comments_ordered_by_submitted ⇒ Object
Helper method to sort comments by date.
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_submitted ⇒ Object
Helper method to sort comments by date
49 50 51 52 53 54 |
# File 'lib/commentable_methods.rb', line 49 def comments_ordered_by_submitted Comment.find(:all, :conditions => ["commentable_id = ? and commentable_type = ?", id, self.type.name], :order => "created_at DESC" ) end |