summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-19 06:37:36 +0000
committerStan Hu <stanhu@gmail.com>2019-03-19 06:37:36 +0000
commit68aacd65ae3c53f3c1d2cf081adc89e3758c52de (patch)
treef581cb1d079a56b2dda90a4774c27af0b54d0b82 /lib
parent909161dd49514db5292ca551d6e288560c29f7b2 (diff)
parent7ce990b16181d05f57df4e89300c5db65b129747 (diff)
downloadgitlab-ce-68aacd65ae3c53f3c1d2cf081adc89e3758c52de.tar.gz
Merge branch '47491-gitlab-fakeapplicationsettings-doesn-t-respond-to-all-the-methods-applicationsetting-responds-to-itself' into 'master'
Introduce ApplicationSettingImplementation Closes #47491 See merge request gitlab-org/gitlab-ce!25803
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/fake_application_settings.rb19
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/gitlab/fake_application_settings.rb b/lib/gitlab/fake_application_settings.rb
index bd806269bf0..77f7d9490f3 100644
--- a/lib/gitlab/fake_application_settings.rb
+++ b/lib/gitlab/fake_application_settings.rb
@@ -7,6 +7,8 @@
# column type without parsing db/schema.rb.
module Gitlab
class FakeApplicationSettings < OpenStruct
+ include ApplicationSettingImplementation
+
# Mimic ActiveRecord predicate methods for boolean values
def self.define_predicate_methods(options)
options.each do |key, value|
@@ -26,20 +28,7 @@ module Gitlab
FakeApplicationSettings.define_predicate_methods(options)
end
- def key_restriction_for(type)
- 0
- end
-
- def allowed_key_types
- ApplicationSetting::SUPPORTED_KEY_TYPES
- end
-
- def pick_repository_storage
- repository_storages.sample
- end
-
- def commit_email_hostname
- super.presence || ApplicationSetting.default_commit_email_hostname
- end
+ alias_method :read_attribute, :[]
+ alias_method :has_attribute?, :[]
end
end