-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix of missing initializer at sprockets. #371
Conversation
They are using Railtie, so there are no special initializer. I've got 'immutable env' error. Which was fixed by that.
Any document that support this change? |
@@ -3,7 +3,7 @@ | |||
module I18n | |||
module JS | |||
class Engine < ::Rails::Engine | |||
initializer "i18n-js.register_preprocessor", :after => "sprockets.environment" do | |||
initializer "i18n-js.register_preprocessor", after: :engines_blank_point, before: :finisher_hook do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, little bit more details:
- Here is where sprockets are attached with Rails. There is no
'sprockets.environment'
mentioned.
https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/railtie.rb - Finisher hook is the place which should be used as border.
http://guides.rubyonrails.org/configuring.html#initializers
https://github.com/rails/sprockets-rails/blob/master/lib/sprockets/railtie.rb#L160
I.e. we should define preprocessors and such before sprockets finalizes configuration. In our case it was using cached environment.
@PikachuEXE Added line comment with more details. |
I was expecting those to be put in comment, but I can add them afterwards Also found a solid reference to "sprockets.environment" Can you add a change log entry (in |
@PikachuEXE Done, please check. |
Thanks. Merging. |
Fix of missing initializer at sprockets.
Merge fnando#376 and fnando#371 to https://github.com/raszi/i18n-js/tree/engine_support because it cannot be cherry-pick or merged to this branch
They are using Railtie, so there are no special initializer. I've got 'immutable env' error. Which was fixed by that.