Description
I'm mixing Rails helpers into my sprockets context per the documentation here:
https://github.com/rails/sprockets/blob/master/lib/sprockets/context.rb#L6-L18
This is happening in a Rails.application.config.after_initialize
block. So something like this
Rails.application.config.after_initialize do
Rails.application.assets.context_class.class_eval do
include RailsViewHelperStuff
end
end
When I precompile assets in the development rails env, this works fine. However, once I start working in an env where Rails.application.config.assets.compile
is false, I get a NoMethodError: undefined method
context_class' for nil:NilClass`.
This appears to be a side effect of #220, which stopped building Rails.application.assets
when Rails.application.config.assets.compile
was false. Because y'all merged #222, I'm guessing that breaking precompilation in this case was an accident rather than you intentionally deprecating the context_class
injection interface.