Sha256: 4ecd0bb09a2a610466b32711a90c23cff7bfd76063b0501bfd17d7392f1e5c87

Contents?: true

Size: 600 Bytes

Versions: 10

Compression:

Stored size: 600 Bytes

Contents

# frozen_string_literal: true

module Talkie
  class Comment < ActiveRecord::Base
    include Talkie::Mentionable if Talkie.mentions_enabled?

    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

    has_many :subscriptions, dependent: :destroy, inverse_of: :comment

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
talkie-0.5.1 app/models/talkie/comment.rb
talkie-0.5.0 app/models/talkie/comment.rb
talkie-0.4.1 app/models/talkie/comment.rb
talkie-0.4.0 app/models/talkie/comment.rb
talkie-0.3.5 app/models/talkie/comment.rb
talkie-0.3.4 app/models/talkie/comment.rb
talkie-0.3.3 app/models/talkie/comment.rb
talkie-0.3.2 app/models/talkie/comment.rb
talkie-0.3.1 app/models/talkie/comment.rb
talkie-0.3.0 app/models/talkie/comment.rb