Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2018-02-07 16:00:53 +0300
committerRubén Dávila <ruben@gitlab.com>2018-02-07 17:04:00 +0300
commitbed948321173b49564f39837e97212ee4dd96e03 (patch)
tree72e6faa9f68378f997f876cf9550561bad546028 /app/serializers/lfs_file_lock_entity.rb
parentead97c55eac773444dee547a934112aa282c2e2e (diff)
Backport of LFS File Locking API
Diffstat (limited to 'app/serializers/lfs_file_lock_entity.rb')
-rw-r--r--app/serializers/lfs_file_lock_entity.rb11
1 files changed, 11 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