Sha256: 1f983ecf5280c29c8262f0be5d1e6f873dd3d3df583d4980ebf3931774aaab04

Contents?: true

Size: 1.42 KB

Versions: 12

Compression:

Stored size: 1.42 KB

Contents

module Hyrax
  module WorkBehavior
    extend ActiveSupport::Concern
    include Hydra::Works::WorkBehavior
    include HumanReadableType
    include Hyrax::Noid
    include Permissions
    include Serializers
    include Hydra::WithDepositor
    include Solrizer::Common
    include HasRepresentative
    include WithFileSets
    include Naming
    include CoreMetadata
    include InAdminSet
    include Hydra::AccessControls::Embargoable
    include GlobalID::Identification
    include NestedWorks
    include Suppressible
    include ProxyDeposit
    include Works::Metadata
    include WithEvents

    included do
      property :owner, predicate: RDF::URI.new('http://opaquenamespace.org/ns/hydra/owner'), multiple: false
      class_attribute :human_readable_short_description
      # TODO: do we need this line?
      self.indexer = WorkIndexer
    end

    # TODO: Move this into ActiveFedora
    def etag
      raise "Unable to produce an etag for a unsaved object" unless persisted?
      ldp_source.head.etag
    end

    module ClassMethods
      # This governs which partial to draw when you render this type of object
      def _to_partial_path #:nodoc:
        @_to_partial_path ||= begin
          element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(name))
          collection = ActiveSupport::Inflector.tableize(name)
          "hyrax/#{collection}/#{element}".freeze
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hyrax-2.0.3 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.2 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.1 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.rc3 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.rc2 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.rc1 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.beta5 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.beta4 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.beta3 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.beta2 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.0.0.beta1 app/models/concerns/hyrax/work_behavior.rb