summaryrefslogtreecommitdiff
path: root/app/finders/ci/daily_build_group_report_results_finder.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/ci/daily_build_group_report_results_finder.rb')
-rw-r--r--app/finders/ci/daily_build_group_report_results_finder.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/finders/ci/daily_build_group_report_results_finder.rb b/app/finders/ci/daily_build_group_report_results_finder.rb
index ec41d9d2c45..ef97ccb4c0f 100644
--- a/app/finders/ci/daily_build_group_report_results_finder.rb
+++ b/app/finders/ci/daily_build_group_report_results_finder.rb
@@ -4,7 +4,7 @@ module Ci
class DailyBuildGroupReportResultsFinder
include Gitlab::Allowable
- def initialize(current_user:, project:, ref_path:, start_date:, end_date:, limit: nil)
+ def initialize(current_user:, project:, ref_path: nil, start_date:, end_date:, limit: nil)
@current_user = current_user
@project = project
@ref_path = ref_path
@@ -35,11 +35,18 @@ module Ci
end
def query_params
- {
+ params = {
project_id: project,
- ref_path: ref_path,
date: start_date..end_date
}
+
+ if ref_path.present?
+ params[:ref_path] = ref_path
+ else
+ params[:default_branch] = true
+ end
+
+ params
end
def none