diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 15:07:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 15:07:47 +0300 |
commit | 96b0c1245c93585a8b0fe23e22306d32ff4e4905 (patch) | |
tree | d2904751e1a2529e8239381ce747339cdbf5116c /lib/feature.rb | |
parent | 0ba3a054d2190094ffda1ebe3aa53ffc5b92247d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/feature.rb')
-rw-r--r-- | lib/feature.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/feature.rb b/lib/feature.rb index 88b0d871c3a..543512b1598 100644 --- a/lib/feature.rb +++ b/lib/feature.rb @@ -52,6 +52,10 @@ class Feature # use `default_enabled: true` to default the flag to being `enabled` # unless set explicitly. The default is `disabled` def enabled?(key, thing = nil, default_enabled: false) + # During setup the database does not exist yet. So we haven't stored a value + # for the feature yet and return the default. + return default_enabled unless Gitlab::Database.exists? + feature = Feature.get(key) # If we're not default enabling the flag or the feature has been set, always evaluate. |