Class Comment
In: app/models/comment.rb
Parent: ActiveRecord::Base

Methods

Public Class methods

[Source]

    # File app/models/comment.rb, line 27
27:     def ordered_active(item_id = nil)
28:       conditions = { :order => "created_at DESC", :conditions => { :active => true } }
29:       if item_id
30:         find_all_by_item_id(item_id, conditions)
31:       else
32:         all(conditions)
33:       end
34:     end

[Source]

    # File app/models/comment.rb, line 23
23:     def page_find(page = 1)
24:       paginate(:page => page, :order => "comments.created_at desc")
25:     end

[Source]

    # File app/models/comment.rb, line 21
21:     def per_page; 25 end

Public Instance methods

[Source]

    # File app/models/comment.rb, line 16
16:   def activate
17:     update_attribute(:active, true)
18:   end

[Source]

    # File app/models/comment.rb, line 12
12:   def suspend
13:     update_attribute(:active, false)
14:   end

[Validate]