Skip to content

Conversation

ronin
Copy link
Contributor

@ronin ronin commented Feb 1, 2014

Here is comment to my previous commit.

So I've found out that Rails.application.routes.prepend doesn't actually do anything besides adding associated block to @prepend variable. Blocks in @prepend run when routes.draw is called and this happens before loading gem routes, so gem routes are not prepended at this time. They are also called after changing application routes.rb, which I did when testing this solution.

Now I've created a Railtie which creates initializer prepending application routes. I've tested in two dummy rails applications (4.0.0 and 3.2.16) and in one real application (3.2.12). It would be great if somebody can test it and confirm that it is working ok now.

@wireframe
Copy link
Owner

I'd love to accept this patch, but I want to try and prevent any future regression as well via a unit test. would you mind taking a stab at a test for this usecase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants