From 9319fc359a9e470388264aeb80b08ad555c56dfc Mon Sep 17 00:00:00 2001 From: gebele Date: Thu, 19 Feb 2015 12:41:26 +0100 Subject: sort models by endpoint list --- application.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'application.rb') diff --git a/application.rb b/application.rb index 7bb96ee..981ee0b 100644 --- a/application.rb +++ b/application.rb @@ -20,6 +20,7 @@ get '/predict/?' do # sort models by endpoint alphabetically $size = 0 @models = @@models.sort!{|a, b| a.type.select{|e| e =~ /endpoint/i} <=> b.type.select{|e| e =~ /endpoint/i}} + @endpoints = @@models.collect{|e| e.type.select{|e| e =~ /endpoint/i}}.sort!.uniq @models.size <= 0 ? (haml :info) : (haml :predict) end -- cgit v1.2.3