summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-05-29 15:42:59 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-29 15:42:59 +0000
commite79f91df8c2a38238ebe5c76862d2f35307bb7f5 (patch)
tree14f6370b8a79f4cf6de1652f763da9fbd49f6faf /lib/api/entities.rb
parent58c50d40524e0b0c23d4c5d7782583e3742047ba (diff)
parent1c5106fadfe59ec4af7235b94d424e4367185c2e (diff)
downloadgitlab-ce-e79f91df8c2a38238ebe5c76862d2f35307bb7f5.tar.gz
Merge branch '46758-fallout-of-cacheable-attribute' into 'master'
Ensure ApplicationSetting#performance_bar_allowed_group_id is properly set when retrieved from cache Closes #46758 See merge request gitlab-org/gitlab-ce!19144
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 3e615f7ac05..3688b44b8df 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -933,8 +933,16 @@ module API
end
class ApplicationSetting < Grape::Entity
- expose :id
- expose(*::ApplicationSettingsHelper.visible_attributes)
+ def self.exposed_attributes
+ attributes = ::ApplicationSettingsHelper.visible_attributes
+ attributes.delete(:performance_bar_allowed_group_path)
+ attributes.delete(:performance_bar_enabled)
+
+ attributes
+ end
+
+ expose :id, :performance_bar_allowed_group_id
+ expose(*exposed_attributes)
expose(:restricted_visibility_levels) do |setting, _options|
setting.restricted_visibility_levels.map { |level| Gitlab::VisibilityLevel.string_level(level) }
end