summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-03 11:30:22 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-03 11:30:22 +0100
commit888fba1e0566d83fef8b2504b3d68a19dbc133f7 (patch)
tree06e1ba2b5820e471c2b7bb58c25c4ee1e7ca8b62
parent030adf12ce6dc8e10a9f0bbb34ff55aa818d7aed (diff)
downloadgitlab-ce-888fba1e0566d83fef8b2504b3d68a19dbc133f7.tar.gz
Order environments twice in environments serializer
-rw-r--r--app/serializers/environment_serializer.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/serializers/environment_serializer.rb b/app/serializers/environment_serializer.rb
index c556424a414..2d8d1f20ddc 100644
--- a/app/serializers/environment_serializer.rb
+++ b/app/serializers/environment_serializer.rb
@@ -42,6 +42,7 @@ class EnvironmentSerializer < BaseSerializer
'MAX(id) AS last_environment_id')
environments = resource.where(id: items.map(&:last))
+ .order('COALESCE(environment_type, name) ASC')
items.zip(environments).map do |item|
Struct::Item.new(*item.flatten)