diff options
author | Bob Van Landuyt <bob@gitlab.com> | 2018-09-11 09:13:23 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-09-11 09:17:44 +0300 |
commit | 8e4d53b161c8611a7159e2333014e94d81ca8e92 (patch) | |
tree | ff25aba42a075ccd6f54e786487c3152f97140dc | |
parent | 1c2553abc565d383a11130f8dfff19ff4fce6841 (diff) |
Merge branch 'sh-fix-ee-issue-7543' into 'master'
Add stub methods for FakeApplicationSetting
Closes gitlab-ee#7543
See merge request gitlab-org/gitlab-ce!21662
-rw-r--r-- | lib/gitlab/fake_application_settings.rb | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/lib/gitlab/fake_application_settings.rb b/lib/gitlab/fake_application_settings.rb index 753160cc562..2c827265d8c 100644 --- a/lib/gitlab/fake_application_settings.rb +++ b/lib/gitlab/fake_application_settings.rb @@ -5,16 +5,6 @@ # column type without parsing db/schema.rb. module Gitlab class FakeApplicationSettings < OpenStruct - def initialize(options = {}) - super - - FakeApplicationSettings.define_predicate_methods(options) - end - - def pick_repository_storage - repository_storages.sample - end - # Mimic ActiveRecord predicate methods for boolean values def self.define_predicate_methods(options) options.each do |key, value| @@ -27,5 +17,23 @@ module Gitlab end end end + + def initialize(options = {}) + super + + 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 end end |