-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix route discovery with api! for Rails 5 (passes tests) #526
Conversation
Since rails deprecated some behavior that the old code depended on, we just change it to match what its been doing under the hood all along and avoid having to do a depth first search at the same time.
…eck your routes. (ArgumentError)
Hi, I think I have a version that has actually tests passing with rails 5, will push in few minutes |
#527, finger crossed |
@iNecas My latest changes make it fully compatible with Rails 5.0 and Ruby 2.2.2+. However, I was forced to make it a breaking change, losing Rails <4 and Ruby <2.2. If yours is more compatible, great, if not please consider accepting this one. |
@iNecas by the way would be awesome to fix the Rails 5 deprecation warnings. |
Closed by #527, thanks @aminariana, you helped a lot speeding up the process! |
Any hint why after this commit namespaced controllers would stop working? I got the following error with this commit:
It claims not to be able to find |
@jsantos seems like this code might be responsible for it https://github.com/Apipie/apipie-rails/pull/526/files#diff-c252ba104efd0ecb906ad2edd58ce884R58 ? |
@iNecas That's my best guess. I'm just wondering if there's anything wrong on my end, but before this commit (and on Rails 4.2.x) everything was running smooth. I was on the middle of the transition to Rails 5 and after upgrading apipie-rails to |
@jsantos I will not get sooner to sending a fix for this until middle of this week: if you want to give it a try and fix it sooner, I will be more than happy to review. |
@iNecas Sure, I'll give it a shot 👍 |
@iNecas Looks like this was a problem on our end (there was a route with no controller associated). Shall we display a more informative error message when this happens? |
👍 on that. Will you give it a try: it would be great, as you know what the reproducer was |
Hi, on adding |
@kklw Check if you have unused routes in your code. Doesn't need to be exactly the one that showed up in your stacktrace, but that was my case. |
@jsantos Thanks! Works perfectly now. |
@iNecas Regarding this "issue" with non-existent routes: What's the best approach? Shall we present a clearer error message? Because continuing silently here doesn't look like a good practice, I'd say. |
I am building this PR on top of PR #465 from June 8, 2016. That one never made it to master because of bad Gemfile values that later got fixed in master, but never got merged into the PR.
In this PR:
Travis is passing 100% for me locally.
Fixes Issue #415
Fixes Issue #495
Fixes Issue #510
Distant relationship with Issue #522
Related to PR #465