Sha256: d865b38ddb2d7728d396f392a4ffa318d320857ec8288c61db8cd3530ae01e27

Contents?: true

Size: 672 Bytes

Versions: 19

Compression:

Stored size: 672 Bytes

Contents

# frozen_string_literal: true
module Sipity
  # Represents a "comment" placed by the given :agent in regards to the give :entity
  class Comment < ActiveRecord::Base
    self.table_name = 'sipity_comments'

    belongs_to :agent, class_name: 'Sipity::Agent'
    belongs_to :entity, class_name: 'Sipity::Entity'

    def name_of_commentor
      agent.proxy_for.to_s
    end
  end

  ##
  # A comment without a database record; always returns an empty string
  class NullComment
    attr_reader :agent, :entity

    def initialize(agent:, entity:)
      @agent = agent
      @entity = entity
    end

    ##
    # @return [String]
    def comment
      ''
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
hyrax-5.0.2 app/models/sipity/comment.rb
hyrax-5.0.1 app/models/sipity/comment.rb
hyrax-5.0.0 app/models/sipity/comment.rb
hyrax-5.0.0.rc3 app/models/sipity/comment.rb
hyrax-5.0.0.rc2 app/models/sipity/comment.rb
hyrax-5.0.0.rc1 app/models/sipity/comment.rb
hyrax-3.6.0 app/models/sipity/comment.rb
hyrax-4.0.0 app/models/sipity/comment.rb
hyrax-4.0.0.rc3 app/models/sipity/comment.rb
hyrax-4.0.0.rc2 app/models/sipity/comment.rb
hyrax-4.0.0.rc1 app/models/sipity/comment.rb
hyrax-3.5.0 app/models/sipity/comment.rb
hyrax-4.0.0.beta2 app/models/sipity/comment.rb
hyrax-3.4.2 app/models/sipity/comment.rb
hyrax-4.0.0.beta1 app/models/sipity/comment.rb
hyrax-3.4.1 app/models/sipity/comment.rb
hyrax-3.4.0 app/models/sipity/comment.rb
hyrax-3.3.0 app/models/sipity/comment.rb
hyrax-3.2.0 app/models/sipity/comment.rb