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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 09:10:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-18 09:10:36 +0300
commite9ae9c5f2ee47b084038ff62319504fc6d0abf20 (patch)
tree6a515ac128d8a351ca028c45e2f29ab1065738a3 /app/models/concerns/sha_attribute.rb
parentedd6fda56d54d7223eb67a15341603e44c3a5f7a (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/sha_attribute.rb')
-rw-r--r--app/models/concerns/sha_attribute.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/concerns/sha_attribute.rb b/app/models/concerns/sha_attribute.rb
index ba7c6c0cd8b..e49f4d03bda 100644
--- a/app/models/concerns/sha_attribute.rb
+++ b/app/models/concerns/sha_attribute.rb
@@ -3,11 +3,14 @@
module ShaAttribute
extend ActiveSupport::Concern
+ # Needed for the database method
+ include DatabaseReflection
+
class_methods do
def sha_attribute(name)
return if ENV['STATIC_VERIFICATION']
- validate_binary_column_exists!(name) if Rails.env.development?
+ validate_binary_column_exists!(name) if Rails.env.development? || Rails.env.test?
attribute(name, Gitlab::Database::ShaAttribute.new)
end