Class: Hyrax::Workflow::StatusListService Deprecated
- Inherits:
-
Object
- Object
- Hyrax::Workflow::StatusListService
- Defined in:
- app/services/hyrax/workflow/status_list_service.rb
Overview
Deprecated.
use the Hyrax::Workflow::ActionableObjects enumerator instead. that service is designed as a more efficient and ergonomic replacement for this one, and has fewer dependencies on specific indexing behavior.
Finds a list of works that a given user can perform a workflow action on.
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#each ⇒ Enumerable<StatusRow>
A list of results that the given user can take action on.
-
#initialize(context_or_user, filter_condition) ⇒ StatusListService
constructor
A new instance of StatusListService.
- #user ⇒ Object deprecated Deprecated.
Constructor Details
#initialize(context_or_user, filter_condition) ⇒ StatusListService
Returns a new instance of StatusListService.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/services/hyrax/workflow/status_list_service.rb', line 16 def initialize(context_or_user, filter_condition) Deprecation .warn("Use the Hyrax::Workflow::ActionableObjects enumerator instead.") case context_or_user when ::User @user = context_or_user when nil raise ArgumentError, "A current user MUST be provided." else Deprecation.warn('Initializing StatusListService with a controller ' \ '"context" is deprecated. Pass in a user instead.') @context = context_or_user @user = @context.current_user end @filter_condition = filter_condition end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
38 39 40 |
# File 'app/services/hyrax/workflow/status_list_service.rb', line 38 def context @context end |
Instance Method Details
#each ⇒ Enumerable<StatusRow>
TODO:
We will want to paginate this
Returns a list of results that the given user can take action on.
44 45 46 47 48 49 50 |
# File 'app/services/hyrax/workflow/status_list_service.rb', line 44 def each return enum_for(:each) unless block_given? solr_documents.each do |doc| yield doc end end |
#user ⇒ Object
Deprecated.
54 55 56 57 58 |
# File 'app/services/hyrax/workflow/status_list_service.rb', line 54 def user Deprecation.warn('This method was always intended to be private. ' \ 'It will be removed in Hyrax 4.0') @user end |