Class: Comment

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/comment.rb

Overview

Schema Information

Table name: comments

id               :integer          not null, primary key
post_id          :integer
commentator_id   :integer
commentator_type :string(255)
content          :text
active           :boolean          default(TRUE)
approved         :boolean          default(FALSE)
reported         :boolean          default(FALSE)
ancestry         :string(255)
created_at       :datetime         not null
updated_at       :datetime         not null

Instance Method Summary collapse

Instance Method Details

#commentator_titleObject



34
35
36
37
38
# File 'app/models/comment.rb', line 34

def commentator_title
  if self.commentator.respond_to?(:title)
    self.commentator.title
  end
end

#titleObject



30
31
32
# File 'app/models/comment.rb', line 30

def title
  [self.article.title,self.content[0..20]].join(" - ")
end