Class: Comment

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

Overview

Schema Information

Table name: comments

id               :integer         not null, primary key
user_id          :integer
commentable_id   :integer
commentable_type :string(255)
private          :boolean
title            :string(255)     default("")
comment          :text
created_at       :datetime
updated_at       :datetime
state            :string(16)      default("Expanded"), not null

Instance Method Summary collapse

Instance Method Details

#collapsed?Boolean

Returns:

  • (Boolean)


48
# File 'app/models/polymorphic/comment.rb', line 48

def collapsed?; self.state == "Collapsed"; end

#expanded?Boolean

Returns:

  • (Boolean)


47
# File 'app/models/polymorphic/comment.rb', line 47

def expanded?;  self.state == "Expanded";  end