Sha256: cab4289135de1f67c2705e170ce88347930b862342b7a86cd9b2a116fcd39e91

Contents?: true

Size: 992 Bytes

Versions: 13

Compression:

Stored size: 992 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  # A work should be able to be filtered out of search results if it's inactive
  module Suppressible
    extend ActiveSupport::Concern

    included do
      # This holds the workflow state
      property :state, predicate: Vocab::FedoraResourceStatus.objState, multiple: false
    end

    ##
    # @deprecated use `Hyrax::ResourceStatus` instead. in most cases,
    #   {#suppressed?} is being called on a {SolrDocumentBehavior}. we continue
    #   to index `suppressed_bsi` and expose its value as an attribute on solr
    #   document objects.
    #
    # Used to restrict visibility on search results for a work that is inactive. If the state is not set, the
    # default behavior is to consider the work not to be suppressed.
    #
    # Override this method if you have some criteria by which records should not display in the search results.
    def suppressed?
      Hyrax::ResourceStatus.new(resource: self).inactive?
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.4 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.3 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.2 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.1 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.0 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.0.rc3 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.0.rc2 app/models/concerns/hyrax/suppressible.rb
hyrax-5.0.0.rc1 app/models/concerns/hyrax/suppressible.rb
hyrax-4.0.0 app/models/concerns/hyrax/suppressible.rb
hyrax-4.0.0.rc3 app/models/concerns/hyrax/suppressible.rb
hyrax-4.0.0.rc2 app/models/concerns/hyrax/suppressible.rb
hyrax-4.0.0.rc1 app/models/concerns/hyrax/suppressible.rb