Skip to content
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

Ensure routes are loaded, prior to generating them #148

Merged
merged 1 commit into from
Jun 14, 2015

Conversation

minasmart
Copy link
Contributor

Some gems and initializers attempt to generate javascript, which can include the routes file, prior to routes be initialized. This addition provides insurance against that.

Notably: This gem will not work with the react-rails gem, due to what happens in the call on this line: https://github.com/reactjs/react-rails/blob/1c03b00b8105c78fbf674abe34be4941084bede4/lib/react/rails/railtie.rb#L62

Manifests, which may include js-routes will be rendered prior to routes being loaded, resulting in an empty set of routes being generated.

This is not, however, the only case where this bug can occur. It happens any time routes are accessed inside an initializer, or in a rails app's after_initialize hook.

@minasmart minasmart force-pushed the FIX-ensure-routes-are-loaded branch from 364e234 to d231d5e Compare June 11, 2015 17:05
@minasmart minasmart changed the title Enuser routes are loaded, prior to generating them Ensure routes are loaded, prior to generating them Jun 11, 2015
le0pard added a commit that referenced this pull request Jun 14, 2015
Ensure routes are loaded, prior to generating them
@le0pard le0pard merged commit 2be4d7d into railsware:master Jun 14, 2015
@le0pard
Copy link
Member

le0pard commented Jun 14, 2015

Thanks!

@minasmart
Copy link
Contributor Author

You're welcome! Glad it helps 👍

@glittershark
Copy link
Contributor

✨ 👍 👍 👍 ✨

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.

3 participants