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-10-01 15:13:32 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-01 15:13:32 +0300
commit6c7d90ede4d2890b2ca740239cd9a5338f12ba34 (patch)
tree59a0fde813364a626fe201dc58316dee001f96e1 /lib/gitlab/utils
parent3cb9e9a5070184e59cb6ff33a4ce381ed14a6fe5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/utils')
-rw-r--r--lib/gitlab/utils/delegator_override/validator.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/utils/delegator_override/validator.rb b/lib/gitlab/utils/delegator_override/validator.rb
index 825b3efa203..402154b41c2 100644
--- a/lib/gitlab/utils/delegator_override/validator.rb
+++ b/lib/gitlab/utils/delegator_override/validator.rb
@@ -51,7 +51,13 @@ module Gitlab
# Workaround to fully load the instance methods in the target class.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69823#note_678887402
- target_classes.map(&:new) rescue nil
+ begin
+ target_classes.map(&:new)
+ rescue ArgumentError
+ # Some models might raise ArgumentError here, but it's fine in this case,
+ # because this is enough to force ActiveRecord to generate the methods we
+ # need to verify, so it's safe to ignore it.
+ end
(delegator_class.instance_methods - allowlist).each do |method_name|
target_classes.each do |target_class|