Skip to content

Commit

Permalink
require 'sprockets' before register_engines. Closes rails#81
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Dec 22, 2011
1 parent 4af598d commit 45aa12c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/sass/rails/railtie.rb
Expand Up @@ -30,11 +30,11 @@ module SassContext
# to the rails generate command
config.app_generators.stylesheet_engine config.sass.preferred_syntax

config.before_initialize do
config.before_initialize do |app|
require 'sass'

# Assume dependency on sprockets, not on app.config.assets enabled.
if defined?(Sprockets::Engines)
if app.config.assets.enabled
require 'sprockets'
Sprockets::Engines #force autoloading
Sprockets.register_engine '.sass', Sass::Rails::SassTemplate
Sprockets.register_engine '.scss', Sass::Rails::ScssTemplate
Expand Down

0 comments on commit 45aa12c

Please sign in to comment.