v3: in service index, sort resources alphabetically

This commit is contained in:
Konstantin Haase 2015-08-25 18:07:21 +02:00
parent ee03ebfbe5
commit 2610c03801

View File

@ -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