Skip to content

Commit

Permalink
Fix Undefined MethodError at app.assets.register_preprocessor for spr…
Browse files Browse the repository at this point in the history
…ockets3.X
  • Loading branch information
Kenta Suzuki committed Dec 28, 2015
1 parent cf4f5b1 commit dca539c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/less/rails/railtie.rb
Expand Up @@ -16,8 +16,8 @@ class Railtie < ::Rails::Railtie
end

initializer 'less-rails.before.load_config_initializers', :before => :load_config_initializers, :group => :all do |app|
app.assets.register_preprocessor 'text/css', ImportProcessor
Sprockets.register_preprocessor 'text/css', ImportProcessor if Sprockets.respond_to?('register_preprocessor')
sprockets_env = app.assets || Sprockets
sprockets_env.register_preprocessor 'text/css', ImportProcessor

config.assets.configure do |env|
env.context_class.class_eval do
Expand Down

0 comments on commit dca539c

Please sign in to comment.