Sha256: 873de31a72314be0eb5fb4dca78d6f9b6e428e0ffcd48a97dbd298b091f1f013

Contents?: true

Size: 1.51 KB

Versions: 32

Compression:

Stored size: 1.51 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 HasRendering
    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
    include Hyrax::CollectionNesting

    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: This can be removed when we upgrade to ActiveFedora 12.0
    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

32 entries across 32 versions & 1 rubygems

Version Path
hyrax-2.9.6 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.9.5 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.9.4 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.9.3 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.9.2 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.9.1 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.9.0 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.8.0 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.7.2 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.7.1 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.7.0 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.6.0 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.5.1 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.5.0 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.4.1 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.4.0 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.3.3 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.3.2 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.3.1 app/models/concerns/hyrax/work_behavior.rb
hyrax-2.3.0 app/models/concerns/hyrax/work_behavior.rb