Class: Gitlab::Diff::FileCollection::PaginatedMergeRequestDiff
- Inherits:
-
MergeRequestDiffBase
- Object
- Base
- MergeRequestDiffBase
- Gitlab::Diff::FileCollection::PaginatedMergeRequestDiff
- Includes:
- PaginatedDiffs
- Defined in:
- lib/gitlab/diff/file_collection/paginated_merge_request_diff.rb
Overview
Builds a traditional paginated diff file collection using Kaminari ‘per` and `per_page` which is different from how `MergeRequestDiffBatch` works (e.g. supports gradual loading).
Constant Summary collapse
- DEFAULT_PAGE =
1
- DEFAULT_PER_PAGE =
30
Instance Attribute Summary
Attributes inherited from Base
#diff_options, #diff_refs, #diffable, #fallback_diff_refs, #project
Instance Method Summary collapse
-
#initialize(merge_request_diff, page, per_page) ⇒ PaginatedMergeRequestDiff
constructor
A new instance of PaginatedMergeRequestDiff.
Methods included from PaginatedDiffs
Methods included from Utils::Override
#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!
Methods inherited from MergeRequestDiffBase
#clear_cache, #diff_files, #raw_diff_files, #write_cache
Methods inherited from Base
#clear_cache, default_options, #diff_file_paths, #diff_file_with_new_path, #diff_file_with_old_path, #diff_files, #diff_paths, #diffs, #overflow?, #pagination_data, #raw_diff_files, #unfold_diff_files, #write_cache
Constructor Details
#initialize(merge_request_diff, page, per_page) ⇒ PaginatedMergeRequestDiff
Returns a new instance of PaginatedMergeRequestDiff.
18 19 20 21 22 |
# File 'lib/gitlab/diff/file_collection/paginated_merge_request_diff.rb', line 18 def initialize(merge_request_diff, page, per_page) super(merge_request_diff, diff_options: nil) @paginated_collection = load_paginated_collection(page, per_page) end |