Sha256: a101813badf0fbab62fac9e7746d70b67b83af233eb96b529c5e039f3264c794

Contents?: true

Size: 436 Bytes

Versions: 3

Compression:

Stored size: 436 Bytes

Contents

module Talkie
  class Comment < ActiveRecord::Base
    default_scope Talkie.default_comments_scope

    acts_as_nested_set :scope => [:commentable_id, :commentable_type],
                       :counter_cache => :children_count

    belongs_to :creator, polymorphic: true, inverse_of: :comments
    belongs_to :commentable, polymorphic: true, inverse_of: :comments

    validates :body, :creator, :commentable, presence: true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
talkie-0.2.0 app/models/talkie/comment.rb
talkie-0.1.1 app/models/talkie/comment.rb
talkie-0.1.0 app/models/talkie/comment.rb