summaryrefslogtreecommitdiff
path: root/app/models/service.rb
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-09-09 20:22:00 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-09-09 20:22:00 +0000
commitafe5f171db0b6b44e54c3c083fb51d24a35981b2 (patch)
tree0e419e594357e5d0c5925ff084f8a9f61dd6ee91 /app/models/service.rb
parenta502a9d2a8b0e89c1f221e3f30016010150b300f (diff)
downloadgitlab-ce-afe5f171db0b6b44e54c3c083fb51d24a35981b2.tar.gz
Expose update project service JSON endpoint
Utilize `json_fields` to expose fields via `Service#as_json(only: json_fields)`.
Diffstat (limited to 'app/models/service.rb')
-rw-r--r--app/models/service.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/service.rb b/app/models/service.rb
index 431c5881460..d866a51c42e 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -107,6 +107,13 @@ class Service < ApplicationRecord
[]
end
+ # Expose a list of fields in the JSON endpoint.
+ #
+ # This list is used in `Service#as_json(only: json_fields)`.
+ def json_fields
+ %w(active)
+ end
+
def test_data(project, user)
Gitlab::DataBuilder::Push.build_sample(project, user)
end