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

Find assets via build_environment in Sprockets 3. #561

Merged
merged 2 commits into from
Jul 29, 2016

Conversation

dstrus
Copy link
Contributor

@dstrus dstrus commented Jul 26, 2016

With config.assets.compile set to false (which it is by default in production in Rails 5), Rails.application.assets returns nil. In that case, we can call Sprockets::Railtie.build_environment(Rails.application).find_asset in place of Rails.application.assets.find_asset.

@unixmonkey
Copy link
Collaborator

Great! Do you think you could extract this out to a private method or something that lines 74 and 106 could also use?

@dstrus
Copy link
Contributor Author

dstrus commented Jul 26, 2016

Done!

@unixmonkey unixmonkey merged commit 0ebd59f into mileszs:master Jul 29, 2016
@unixmonkey
Copy link
Collaborator

Thanks a ton!

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