diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-02-07 16:00:53 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-02-07 17:04:00 +0300 |
commit | bed948321173b49564f39837e97212ee4dd96e03 (patch) | |
tree | 72e6faa9f68378f997f876cf9550561bad546028 /app/serializers | |
parent | ead97c55eac773444dee547a934112aa282c2e2e (diff) |
Backport of LFS File Locking API
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/lfs_file_lock_entity.rb | 11 | ||||
-rw-r--r-- | app/serializers/lfs_file_lock_serializer.rb | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app/serializers/lfs_file_lock_entity.rb b/app/serializers/lfs_file_lock_entity.rb new file mode 100644 index 00000000000..264a77adc3f --- /dev/null +++ b/app/serializers/lfs_file_lock_entity.rb @@ -0,0 +1,11 @@ +class LfsFileLockEntity < Grape::Entity + root 'locks', 'lock' + + expose :path + expose(:id) { |entity| entity.id.to_s } + expose(:created_at, as: :locked_at) { |entity| entity.created_at.to_s(:iso8601) } + + expose :owner do + expose(:name) { |entity| entity.user&.name } + end +end diff --git a/app/serializers/lfs_file_lock_serializer.rb b/app/serializers/lfs_file_lock_serializer.rb new file mode 100644 index 00000000000..ba8fb1a461d --- /dev/null +++ b/app/serializers/lfs_file_lock_serializer.rb @@ -0,0 +1,3 @@ +class LfsFileLockSerializer < BaseSerializer + entity LfsFileLockEntity +end |