summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-11-01 18:35:14 +0100
committerJarka Kadlecova <jarka@gitlab.com>2017-11-02 07:14:35 +0100
commit064c8949bd2cbbd304909b84f4ddac3c80827b94 (patch)
tree2eda37a87768439b4485dd161b8aa0fe809ad923 /app/serializers
parent101779e4e9fd83ef1890a7499ef9b2723fb75cbf (diff)
downloadgitlab-ce-064c8949bd2cbbd304909b84f4ddac3c80827b94.tar.gz
CE port of code changed for epicsjk-epic-changes-ce-port
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/issuable_entity.rb8
-rw-r--r--app/serializers/issue_entity.rb4
-rw-r--r--app/serializers/merge_request_entity.rb4
-rw-r--r--app/serializers/time_trackable_entity.rb11
4 files changed, 19 insertions, 8 deletions
diff --git a/app/serializers/issuable_entity.rb b/app/serializers/issuable_entity.rb
index 61c7a428745..3b5a4fd4f79 100644
--- a/app/serializers/issuable_entity.rb
+++ b/app/serializers/issuable_entity.rb
@@ -1,20 +1,16 @@
class IssuableEntity < Grape::Entity
+ include RequestAwareEntity
+
expose :id
expose :iid
expose :author_id
expose :description
expose :lock_version
expose :milestone_id
- expose :state
expose :title
expose :updated_by_id
expose :created_at
expose :updated_at
- expose :deleted_at
- expose :time_estimate
- expose :total_time_spent
- expose :human_time_estimate
- expose :human_total_time_spent
expose :milestone, using: API::Entities::Milestone
expose :labels, using: LabelEntity
end
diff --git a/app/serializers/issue_entity.rb b/app/serializers/issue_entity.rb
index 10d3ad0214b..5f47592e4ad 100644
--- a/app/serializers/issue_entity.rb
+++ b/app/serializers/issue_entity.rb
@@ -1,6 +1,8 @@
class IssueEntity < IssuableEntity
- include RequestAwareEntity
+ include TimeTrackableEntity
+ expose :state
+ expose :deleted_at
expose :branch_name
expose :confidential
expose :discussion_locked
diff --git a/app/serializers/merge_request_entity.rb b/app/serializers/merge_request_entity.rb
index 297a459e394..b53a49fe59e 100644
--- a/app/serializers/merge_request_entity.rb
+++ b/app/serializers/merge_request_entity.rb
@@ -1,6 +1,8 @@
class MergeRequestEntity < IssuableEntity
- include RequestAwareEntity
+ include TimeTrackableEntity
+ expose :state
+ expose :deleted_at
expose :in_progress_merge_commit_sha
expose :merge_commit_sha
expose :merge_error
diff --git a/app/serializers/time_trackable_entity.rb b/app/serializers/time_trackable_entity.rb
new file mode 100644
index 00000000000..e81cd7bec72
--- /dev/null
+++ b/app/serializers/time_trackable_entity.rb
@@ -0,0 +1,11 @@
+module TimeTrackableEntity
+ extend ActiveSupport::Concern
+ extend Grape
+
+ included do
+ expose :time_estimate
+ expose :total_time_spent
+ expose :human_time_estimate
+ expose :human_total_time_spent
+ end
+end