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

Methods

Public Class methods

[Source]

    # File app/models/comment.rb, line 38
38:   def self.recent(limit = nil)
39:     self.find(:all, :order => 'created_at desc, id desc', :limit => limit)
40:   end

Public Instance methods

[Source]

    # File app/models/comment.rb, line 34
34:   def anchor
35:     "comment-#{id}"
36:   end

[Source]

    # File app/models/comment.rb, line 22
22:   def author_name
23:     if author
24:       author.name
25:     else
26:       name
27:     end
28:   end

[Source]

    # File app/models/comment.rb, line 44
44:   def notify_article
45:     article.comments_updated
46:   end

[Source]

    # File app/models/comment.rb, line 30
30:   def url
31:     article.url.merge(:anchor => anchor)
32:   end

[Validate]