Class: Boards::Issues::ListService
- Inherits:
-
BaseService
- Object
- BaseService
- BaseService
- Boards::Issues::ListService
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/services/boards/issues/list_service.rb
Instance Attribute Summary
Attributes inherited from BaseService
#current_user, #params, #parent
Attributes inherited from BaseService
#current_user, #params, #project
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#metadata ⇒ Object
rubocop: disable CodeReuse/ActiveRecord.
Methods included from Gitlab::Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Methods inherited from BaseService
Methods inherited from BaseService
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
This class inherits a constructor from Boards::BaseService
Class Method Details
.valid_params ⇒ Object
8 9 10 |
# File 'app/services/boards/issues/list_service.rb', line 8 def self.valid_params IssuesFinder.valid_params end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 |
# File 'app/services/boards/issues/list_service.rb', line 12 def execute return fetch_issues.order_closed_date_desc if list&.closed? fetch_issues.order_by_position_and_priority(with_cte: params[:search].present?) end |
#metadata ⇒ Object
rubocop: disable CodeReuse/ActiveRecord
19 20 21 22 23 24 25 26 27 |
# File 'app/services/boards/issues/list_service.rb', line 19 def issues = Issue.arel_table keys = .keys # TODO: eliminate need for SQL literal fragment columns = Arel.sql(.values_at(*keys).join(', ')) results = Issue.where(id: fetch_issues.select(issues[:id])).pluck(columns) Hash[keys.zip(results.flatten)] end |