From 2610c03801416e350216a5b6d4882f355aa7d025 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Tue, 25 Aug 2015 18:07:21 +0200 Subject: [PATCH] v3: in service index, sort resources alphabetically --- lib/travis/api/v3/service_index.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/travis/api/v3/service_index.rb b/lib/travis/api/v3/service_index.rb index cca15311..79e3f3e3 100644 --- a/lib/travis/api/v3/service_index.rb +++ b/lib/travis/api/v3/service_index.rb @@ -24,7 +24,7 @@ module Travis::API::V3 def render_json resources = { } - routes.resources.each do |resource| + routes.resources.sort_by(&:identifier).each do |resource| data = resources[resource.identifier] ||= { :@type => :resource, :actions => {} } if renderer = Renderer[resource.identifier, false] and renderer.respond_to? :representations data[:representations] = renderer.representations