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/metric_definition.rb')
-rw-r--r--lib/gitlab/usage/metric_definition.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/usage/metric_definition.rb b/lib/gitlab/usage/metric_definition.rb
index 7cfd9d2c5e9..db0cb4c6326 100644
--- a/lib/gitlab/usage/metric_definition.rb
+++ b/lib/gitlab/usage/metric_definition.rb
@@ -55,6 +55,10 @@ module Gitlab
end
end
+ def category_to_lowercase
+ attributes[:data_category]&.downcase!
+ end
+
alias_method :to_dictionary, :to_h
class << self
@@ -96,7 +100,7 @@ module Gitlab
definition = YAML.safe_load(definition)
definition.deep_symbolize_keys!
- self.new(path, definition).tap(&:validate!)
+ self.new(path, definition).tap(&:validate!).tap(&:category_to_lowercase)
rescue StandardError => e
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(InvalidError.new(e.message))
end