lib/ember/rails/engine.rb in ember-rails-lite-0.8.0 vs lib/ember/rails/engine.rb in ember-rails-lite-0.9.2

- old
+ new

@@ -7,16 +7,19 @@ config.handlebars.precompile = true config.handlebars.templates_root = "templates" config.handlebars.templates_path_separator = '/' - initializer "ember_rails.setup", :group => :all do |app| - require 'ember/filters/slim' if defined? Slim - require 'ember/filters/haml' if defined? Haml + initializer "ember_rails.setup", :after => :append_assets_path, :group => :all do |app| + sprockets = if ::Rails::VERSION::MAJOR == 4 + Sprockets.respond_to?('register_engine') ? Sprockets : app.assets + else + app.assets + end - app.assets.register_engine '.handlebars', Ember::Handlebars::Template - app.assets.register_engine '.hbs', Ember::Handlebars::Template - app.assets.register_engine '.hjs', Ember::Handlebars::Template + sprockets.register_engine '.handlebars', Ember::Handlebars::Template + sprockets.register_engine '.hbs', Ember::Handlebars::Template + sprockets.register_engine '.hjs', Ember::Handlebars::Template end end end end