diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-20 03:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-20 03:09:13 +0300 |
commit | c0bc64e25edb4d7c3ac1d89de720f94782be5d2e (patch) | |
tree | 7cce86fcd83c9ba6fe7c3eb418f19a982d6eff3d /lib | |
parent | 1cd61065a0d86b492be5086906429ac5956e3672 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/current_settings.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/fake_application_settings.rb | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb index 64e0478734b..a42b086319d 100644 --- a/lib/gitlab/current_settings.rb +++ b/lib/gitlab/current_settings.rb @@ -24,12 +24,18 @@ module Gitlab Gitlab::SafeRequestStore.delete(:current_application_settings) end + # rubocop:disable GitlabSecurity/PublicSend -- Method calls are forwarded to one of the setting classes def method_missing(name, *args, **kwargs, &block) - current_application_settings.send(name, *args, **kwargs, &block) # rubocop:disable GitlabSecurity/PublicSend + application_settings = current_application_settings + + return application_settings.send(name, *args, **kwargs, &block) if application_settings.respond_to?(name) + + Organizations::OrganizationSetting.for_current_organization.send(name, *args, **kwargs, &block) end + # rubocop:enable GitlabSecurity/PublicSend def respond_to_missing?(name, include_private = false) - current_application_settings.respond_to?(name, include_private) || super + current_application_settings.respond_to?(name, include_private) || Organizations::OrganizationSetting.for_current_organization.respond_to?(name, include_private) || super end end end diff --git a/lib/gitlab/fake_application_settings.rb b/lib/gitlab/fake_application_settings.rb index 0b9a4c161ae..da99d9b1b70 100644 --- a/lib/gitlab/fake_application_settings.rb +++ b/lib/gitlab/fake_application_settings.rb @@ -46,6 +46,10 @@ module Gitlab def method_missing(*) nil end + + def respond_to_missing?(*) + true + end end end |