summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorHan Loong Liauw <hanloongliauw@gmail.com>2015-10-17 09:30:43 +1100
committerHan Loong Liauw <hanloongliauw@gmail.com>2015-10-17 09:30:43 +1100
commit1565a95da17ba8425486839d0712a9141d66b98f (patch)
treed2a9d3afaf90b12c1a71fa8c82ac168becd5c75b /lib/api/entities.rb
parent45e11d95f27584f699392fad8f54c1807e562d7f (diff)
parentc856a7a5934fba13598be09507c2090888f57a39 (diff)
downloadgitlab-ce-1565a95da17ba8425486839d0712a9141d66b98f.tar.gz
Merge branch 'master' into add-dates-snippets-show
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 519072d0157..883a5e14b17 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -262,6 +262,18 @@ module API
expose :notification_level
end
+ class ProjectService < Grape::Entity
+ expose :id, :title, :created_at, :updated_at, :active
+ expose :push_events, :issues_events, :merge_requests_events, :tag_push_events, :note_events
+ # Expose serialized properties
+ expose :properties do |service, options|
+ field_names = service.fields.
+ select { |field| options[:include_passwords] || field[:type] != 'password' }.
+ map { |field| field[:name] }
+ service.properties.slice(*field_names)
+ end
+ end
+
class ProjectWithAccess < Project
expose :permissions do
expose :project_access, using: Entities::ProjectAccess do |project, options|