summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-05-20 14:48:47 +1200
committerThong Kuah <tkuah@gitlab.com>2019-08-28 00:04:12 +1200
commit9ff86452b0c2f21c1f86cd1a14dde69c62d2ff65 (patch)
tree1d570e6be2d5a26c0017b769a0662ae03948cd26 /app/models
parentdf3c259da67e7184ba8590a1ce55cc43a1247668 (diff)
downloadgitlab-ce-59719-const-get-rubocop.tar.gz
Address ConstGetInheritFalse violations59719-const-get-rubocop
There should be no cases where we need to inherit=true.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/clusters/concerns/application_version.rb4
-rw-r--r--app/models/concerns/prometheus_adapter.rb2
-rw-r--r--app/models/note.rb2
-rw-r--r--app/models/upload.rb2
4 files changed, 5 insertions, 5 deletions
diff --git a/app/models/clusters/concerns/application_version.rb b/app/models/clusters/concerns/application_version.rb
index db94e8e08c9..6c0b014662c 100644
--- a/app/models/clusters/concerns/application_version.rb
+++ b/app/models/clusters/concerns/application_version.rb
@@ -8,13 +8,13 @@ module Clusters
included do
state_machine :status do
before_transition any => [:installed, :updated] do |application|
- application.version = application.class.const_get(:VERSION)
+ application.version = application.class.const_get(:VERSION, false)
end
end
end
def update_available?
- version != self.class.const_get(:VERSION)
+ version != self.class.const_get(:VERSION, false)
end
end
end
diff --git a/app/models/concerns/prometheus_adapter.rb b/app/models/concerns/prometheus_adapter.rb
index 9ac4722c6b1..fc3266baf65 100644
--- a/app/models/concerns/prometheus_adapter.rb
+++ b/app/models/concerns/prometheus_adapter.rb
@@ -42,7 +42,7 @@ module PrometheusAdapter
end
def query_klass_for(query_name)
- Gitlab::Prometheus::Queries.const_get("#{query_name.to_s.classify}Query")
+ Gitlab::Prometheus::Queries.const_get("#{query_name.to_s.classify}Query", false)
end
def build_query_args(*args)
diff --git a/app/models/note.rb b/app/models/note.rb
index a12d1eb7243..132f5f6fae1 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -25,7 +25,7 @@ class Note < ApplicationRecord
class << self
def values
- constants.map {|const| self.const_get(const)}
+ constants.map {|const| self.const_get(const, false)}
end
def value?(val)
diff --git a/app/models/upload.rb b/app/models/upload.rb
index ca74f16b3b8..deb383b8f82 100644
--- a/app/models/upload.rb
+++ b/app/models/upload.rb
@@ -114,7 +114,7 @@ class Upload < ApplicationRecord
end
def uploader_class
- Object.const_get(uploader)
+ Object.const_get(uploader, false)
end
def identifier