update Grape routes to work with current version of Grape

This commit is contained in:
James Lopez 2017-02-06 10:28:03 +01:00
parent 1bbc99f1c8
commit 014db24aae
1 changed files with 7 additions and 1 deletions

View File

@ -2,7 +2,13 @@ namespace :grape do
desc 'Print compiled grape routes'
task routes: :environment do
API::API.routes.each do |route|
puts route
puts "#{route.options[:method]} #{route.path} - #{route_description(route.options)}"
end
end
def route_description(options)
if options[:settings][:description]
options[:settings][:description][:description]
end || ''
end
end