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)


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

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

#expanded?Boolean

Returns:

  • (Boolean)


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

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