Sha256: 7c7796389bd9d9055a7b6d5e3be8c73ba1d6405a846514ae6a0e693eefac68c0

Contents?: true

Size: 1 KB

Versions: 17

Compression:

Stored size: 1 KB

Contents

module Sipity
  # A proxy for the entity that is being processed.
  # By using a proxy, we need not worry about polluting the proxy's concerns
  # with things related to processing.
  #
  # The goal is to keep this behavior separate, so that we can possibly
  # extract the information.
  class Entity < ActiveRecord::Base
    self.table_name = 'sipity_entities'

    belongs_to :workflow, class_name: 'Sipity::Workflow'
    belongs_to :workflow_state, class_name: 'Sipity::WorkflowState'

    has_many :entity_specific_responsibilities, dependent: :destroy, class_name: 'Sipity::EntitySpecificResponsibility'

    has_many :comments,
             foreign_key: :entity_id,
             dependent: :destroy,
             class_name: 'Sipity::Comment'

    def workflow_state_name
      workflow_state.name if workflow_state
    end

    # Defines the method #workflow_name
    delegate :name, to: :workflow, prefix: :workflow

    def proxy_for
      @proxy_for ||= GlobalID::Locator.locate(proxy_for_global_id)
    end
  end
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
curation_concerns-1.7.8 app/models/sipity/entity.rb
hyrax-1.0.1 app/models/sipity/entity.rb
hyrax-1.0.0.rc2 app/models/sipity/entity.rb
curation_concerns-1.7.7 app/models/sipity/entity.rb
curation_concerns-2.0.0 app/models/sipity/entity.rb
curation_concerns-2.0.0.rc2 app/models/sipity/entity.rb
hyrax-1.0.0.rc1 app/models/sipity/entity.rb
curation_concerns-1.7.6 app/models/sipity/entity.rb
curation_concerns-1.7.5 app/models/sipity/entity.rb
test_hyrax-0.0.1.alpha app/models/sipity/entity.rb
curation_concerns-1.7.4 app/models/sipity/entity.rb
curation_concerns-1.7.3 app/models/sipity/entity.rb
curation_concerns-1.7.2 app/models/sipity/entity.rb
curation_concerns-2.0.0.rc1 app/models/sipity/entity.rb
curation_concerns-1.7.1 app/models/sipity/entity.rb
curation_concerns-1.7.0 app/models/sipity/entity.rb
curation_concerns-1.7.0.beta1 app/models/sipity/entity.rb