Module: Hyrax::Suppressible
- Extended by:
- ActiveSupport::Concern
- Included in:
- WorkBehavior
- Defined in:
- app/models/concerns/hyrax/suppressible.rb
Overview
A work should be able to be filtered out of search results if it’s inactive
Instance Method Summary collapse
-
#suppressed? ⇒ Boolean
Used to restrict visibility on search results for a work that is inactive.
-
#to_sipity_entity ⇒ Object
deprecated
Deprecated.
Use ‘Sipity::Entity(entity)` instead.
Instance Method Details
#suppressed? ⇒ Boolean
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.
17 18 19 |
# File 'app/models/concerns/hyrax/suppressible.rb', line 17 def suppressed? Hyrax::ResourceStatus.new(resource: self).inactive? end |
#to_sipity_entity ⇒ Object
Deprecated.
Use ‘Sipity::Entity(entity)` instead.
23 24 25 26 27 |
# File 'app/models/concerns/hyrax/suppressible.rb', line 23 def to_sipity_entity Deprecation.warn "Use `Sipity::Entity(entity)` instead." raise "Can't create an entity until the model has been persisted" unless persisted? @sipity_entity ||= Sipity::Entity(to_global_id) end |