summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-03 12:27:30 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-05-03 12:27:30 +0200
commit738bf2c23891467dbc9c74d08223fd3c4e432ae7 (patch)
tree46f3aecaa33309822710a3aac2bb211a4855b37b /app/serializers
parenteb45582f55cae42acc41fa228f4797b4067c01dc (diff)
parent40cc917a9c07263db062c03f62c8056ed40197bd (diff)
downloadgitlab-ce-738bf2c23891467dbc9c74d08223fd3c4e432ae7.tar.gz
Merge branch 'master' into feature/gb/manual-actions-protected-branches-permissions
* master: (103 commits) Include missing project attributes to Import/Export Create the rest of the wiki docs Fill in information about creating the wiki Home page Move wiki doc to its own index page Create initial file for Wiki documentation Default to null user when asignee is unselected Re-enable ref operations with gitaly after not-found fix #31560 Add repo parameter to gitaly:install and workhorse:install Remove N+1 queries when checking nodes visible to user Don't validate reserved words if the format doesn't match Revert "Shorten and improve some job names" Remove unused initializer DRY the `<<: *except-docs` a bit in `.gitlab-ci.yml` Make the static-analysis job be run for docs branches too Add download_snippet_path helper Refresh the markdown cache if it was `nil` Add some documentation for the new migration helpers Update comments Display comments for personal snippets Update docs on creating a project ...
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/deployment_entity.rb2
-rw-r--r--app/serializers/deployment_serializer.rb8
-rw-r--r--app/serializers/status_entity.rb5
3 files changed, 14 insertions, 1 deletions
diff --git a/app/serializers/deployment_entity.rb b/app/serializers/deployment_entity.rb
index d610fbe0c8a..8b3de1bed0f 100644
--- a/app/serializers/deployment_entity.rb
+++ b/app/serializers/deployment_entity.rb
@@ -18,8 +18,10 @@ class DeploymentEntity < Grape::Entity
end
end
+ expose :created_at
expose :tag
expose :last?
+
expose :user, using: UserEntity
expose :commit, using: CommitEntity
expose :deployable, using: BuildEntity
diff --git a/app/serializers/deployment_serializer.rb b/app/serializers/deployment_serializer.rb
new file mode 100644
index 00000000000..cba5c3f311f
--- /dev/null
+++ b/app/serializers/deployment_serializer.rb
@@ -0,0 +1,8 @@
+class DeploymentSerializer < BaseSerializer
+ entity DeploymentEntity
+
+ def represent_concise(resource, opts = {})
+ opts[:only] = [:iid, :id, :sha, :created_at, :tag, :last?, :id, ref: [:name]]
+ represent(resource, opts)
+ end
+end
diff --git a/app/serializers/status_entity.rb b/app/serializers/status_entity.rb
index 944472f3e51..188c3747f18 100644
--- a/app/serializers/status_entity.rb
+++ b/app/serializers/status_entity.rb
@@ -7,6 +7,9 @@ class StatusEntity < Grape::Entity
expose :details_path
expose :favicon do |status|
- ActionController::Base.helpers.image_path(File.join('ci_favicons', "#{status.favicon}.ico"))
+ dir = 'ci_favicons'
+ dir = File.join(dir, 'dev') if Rails.env.development?
+
+ ActionController::Base.helpers.image_path(File.join(dir, "#{status.favicon}.ico"))
end
end