{"action":"created","issue":{"url":"https://api.github.com/repos/railsware/js-routes/issues/181","repository_url":"https://api.github.com/repos/railsware/js-routes","labels_url":"https://api.github.com/repos/railsware/js-routes/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/railsware/js-routes/issues/181/comments","events_url":"https://api.github.com/repos/railsware/js-routes/issues/181/events","html_url":"https://github.com/railsware/js-routes/issues/181","id":137530669,"number":181,"title":"SystemStackError with gem","user":{"login":"lowjoel","id":2505070,"avatar_url":"https://avatars.githubusercontent.com/u/2505070?v=3","gravatar_id":"","url":"https://api.github.com/users/lowjoel","html_url":"https://github.com/lowjoel","followers_url":"https://api.github.com/users/lowjoel/followers","following_url":"https://api.github.com/users/lowjoel/following{/other_user}","gists_url":"https://api.github.com/users/lowjoel/gists{/gist_id}","starred_url":"https://api.github.com/users/lowjoel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowjoel/subscriptions","organizations_url":"https://api.github.com/users/lowjoel/orgs","repos_url":"https://api.github.com/users/lowjoel/repos","events_url":"https://api.github.com/users/lowjoel/events{/privacy}","received_events_url":"https://api.github.com/users/lowjoel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2016-03-01T10:15:36Z","updated_at":"2016-03-13T12:17:29Z","closed_at":null,"body":"Hi there, I just set up the gem as given in the Readme, and when restarting my server, I get\r\n\r\n```\r\n<snip>\r\nvendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.2/lib/active_support/core_ext/array/conversions.rb:98:in `inspect'\r\nvendor/bundle/ruby/2.3.0/gems/activesupport-4.2.5.2/lib/active_support/core_ext/array/conversions.rb:98:in `to_formatted_s'\r\nvendor/bundle/ruby/2.3.0/gems/js-routes-1.2.4/lib/js_routes.rb:153:in `each'\r\nvendor/bundle/ruby/2.3.0/gems/js-routes-1.2.4/lib/js_routes.rb:153:in `sort_by'\r\nvendor/bundle/ruby/2.3.0/gems/js-routes-1.2.4/lib/js_routes.rb:153:in `js_routes'\r\n```\r\n\r\n`Rails.application.routes.named_routes.to_a` returns an array of pairs, with each pair being the name of the route and the ActionDispatch::Journey::Route. Calling #to_s on any of those pairs seem to be triggering a StackError.\r\n\r\nI'm using Rails 4.2.5.2. Is there anything I can do to work around this?"},"comment":{"url":"https://api.github.com/repos/railsware/js-routes/issues/comments/195947159","html_url":"https://github.com/railsware/js-routes/issues/181#issuecomment-195947159","issue_url":"https://api.github.com/repos/railsware/js-routes/issues/181","id":195947159,"user":{"login":"lowjoel","id":2505070,"avatar_url":"https://avatars.githubusercontent.com/u/2505070?v=3","gravatar_id":"","url":"https://api.github.com/users/lowjoel","html_url":"https://github.com/lowjoel","followers_url":"https://api.github.com/users/lowjoel/followers","following_url":"https://api.github.com/users/lowjoel/following{/other_user}","gists_url":"https://api.github.com/users/lowjoel/gists{/gist_id}","starred_url":"https://api.github.com/users/lowjoel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lowjoel/subscriptions","organizations_url":"https://api.github.com/users/lowjoel/orgs","repos_url":"https://api.github.com/users/lowjoel/repos","events_url":"https://api.github.com/users/lowjoel/events{/privacy}","received_events_url":"https://api.github.com/users/lowjoel/received_events","type":"User","site_admin":false},"created_at":"2016-03-13T12:17:29Z","updated_at":"2016-03-13T12:17:29Z","body":"Sorting by `to_s` was introduced in d7dcfd45ae59dd8bea595f3bc5598567a0ec82f5, which was supposed to sort every route by key.\r\n\r\nRails.application.routes.named_routes.to_a.first.to_s returns a string like this:\r\n\r\n```\r\n\"[:root, #<ActionDispatch::Journey::Route:0x0000a8ecc362f8 @name=\"root\", @app=#<ActionDispatch::Routing::RouteSet::Dispatcher:0x0000a8ecc370b8 @defaults={:controller=>\"application\", :action=>\"index\"}>, @path=#<ActionDispatch::Journey::Path::Pattern:0x0000a8ecc36f78 @spec=#<ActionDispatch::Journey::Nodes::Slash:0x0000a8ecc486d8 @left=\"/\", @memo=nil>, @requirements={}, @separators=\"/.?\", @anchored=true, @names=[], @optional_names=[], @required_names=[], @re=nil, @offsets=nil>, @constraints={:required_defaults=>[:controller, :action], :request_method=>/^GET$/}, @defaults={:controller=>\"application\", :action=>\"index\"}, @required_defaults=nil, @required_parts=[], @parts=[], @decorated_ast=nil, @precedence=1, @path_formatter=#<ActionDispatch::Journey::Format:0x0000a8ecc36280 @parts=[\"/\"], @children=[], @parameters=[]>>]\"\r\n```\r\n\r\nWhy does the entire ActionDispatch::Journey::Route object need to be used as part of the sorting? What the gem really cares about is the path name, which is just the `first` of the pair?"}}