Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/usage/time_frame.rb')
-rw-r--r--lib/gitlab/usage/time_frame.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab/usage/time_frame.rb b/lib/gitlab/usage/time_frame.rb
index 966a087ee07..39b0855b917 100644
--- a/lib/gitlab/usage/time_frame.rb
+++ b/lib/gitlab/usage/time_frame.rb
@@ -6,6 +6,7 @@ module Gitlab
ALL_TIME_TIME_FRAME_NAME = "all"
SEVEN_DAYS_TIME_FRAME_NAME = "7d"
TWENTY_EIGHT_DAYS_TIME_FRAME_NAME = "28d"
+ DEFAULT_TIMESTAMP_COLUMN = :created_at
def weekly_time_range
{ start_date: 7.days.ago.to_date, end_date: Date.current }
@@ -17,8 +18,8 @@ module Gitlab
# This time range is skewed for batch counter performance.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42972
- def monthly_time_range_db_params(column: :created_at)
- { column => 30.days.ago..2.days.ago }
+ def monthly_time_range_db_params(column: nil)
+ { (column || DEFAULT_TIMESTAMP_COLUMN) => 30.days.ago..2.days.ago }
end
end
end