Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
Bug fix: Asset pipeline was throwing can't modify immutable index.
Browse files Browse the repository at this point in the history
Moving the `ActiveSupport.on_load(:after_initialize)` inside the `sprockets.environment` initializer wasn't enough. So we're checking if the `compile` flag is set, before registering the dependencies.
  • Loading branch information
fnando committed May 10, 2012
1 parent 1c2914f commit b6ac6b6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/i18n/js/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Engine < ::Rails::Engine

ActiveSupport.on_load(:after_initialize, :yield => true) do
next unless JS.has_asset_pipeline?
next unless Rails.configuration.assets.compile

Rails.application.assets.register_preprocessor "application/javascript", :"i18n-js_dependencies" do |context, source|
next source unless context.logical_path == "i18n/translations"
Expand Down

0 comments on commit b6ac6b6

Please sign in to comment.