Class: Comment

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

Overview

Copyright © 2008-2013 Michael Dvorkin and contributors.

Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php


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)


41
42
43
# File 'app/models/polymorphic/comment.rb', line 41

def collapsed?
  state == "Collapsed"
end

#expanded?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'app/models/polymorphic/comment.rb', line 37

def expanded?
  state == "Expanded"
end