Module: Pipeline::InboxGroupedBySubmission

Included in:
CherrypickingPipeline
Defined in:
app/models/pipeline/inbox_grouped_by_submission.rb

Overview

A pipeline that has its inbox grouped by submission needs to provide specific paging capabilities. All requests for a submission must appear on the same page, i.e. if a submission has 200 requests and there are only 100 allowed per page, then all of these requests must appear on a page and not across two.

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



7
8
9
10
11
12
13
14
# File 'app/models/pipeline/inbox_grouped_by_submission.rb', line 7

def self.included(base)
  # rubocop:todo Rails/HasManyOrHasOneDependent
  base.has_many :inbox, class_name: 'Request', extend: [Pipeline::RequestsInStorage]

  # rubocop:enable Rails/HasManyOrHasOneDependent
  base.group_by_submission = true
  base.request_sort_order = { submission_id: :desc, id: :asc }.freeze
end