Sha256: b65469fe179200b25aba35623bdd90b2ca398144dcbafe6fa15691c38b8a26a6

Contents?: true

Size: 832 Bytes

Versions: 11

Compression:

Stored size: 832 Bytes

Contents

# Generated from acts_as_commentable
#------------------------------------------------------------------------------
class Comment < ActiveRecord::Base
  include           ActsAsCommentable::Comment

  self.table_name   = 'core_comments'

  belongs_to        :commentable, :polymorphic => true, :counter_cache => true
  has_ancestry      :cache_depth => true

  #--- don't add ordering to default scope, as it messes with calculating recent_comment
  default_scope     { where(account_id: Account.current.id) }

  #--- NOTE: install the acts_as_votable plugin to vote on the quality of comments
  #acts_as_voteable

  #--- don't use a counter cache until you can seperate users per account
  belongs_to        :user #, :counter_cache => true
  belongs_to        :account
  
  validates_presence_of   :body
  self.per_page = 10

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
dm_core-4.2.3.5 app/models/comment.rb
dm_core-4.2.3.4 app/models/comment.rb
dm_core-4.2.3.3 app/models/comment.rb
dm_core-4.2.3.2 app/models/comment.rb
dm_core-4.2.3.1 app/models/comment.rb
dm_core-4.2.3 app/models/comment.rb
dm_core-4.2.2.3 app/models/comment.rb
dm_core-4.2.2.2 app/models/comment.rb
dm_core-4.2.2.1 app/models/comment.rb
dm_core-4.2.2 app/models/comment.rb
dm_core-4.2.1.5 app/models/comment.rb