lib/ember/appkit/rails/engine.rb in ember-appkit-rails-0.2.1 vs lib/ember/appkit/rails/engine.rb in ember-appkit-rails-0.2.2

- old
+ new

@@ -33,9 +33,15 @@ get '/' => "landing#index" end end initializer :appkit_sprockets do - Sprockets::Railtie.config.assets.paths.unshift(File.join(::Rails.root, config.ember.appkit.paths.config)) - Sprockets::Railtie.config.assets.paths.unshift(File.join(::Rails.root, config.ember.appkit.paths.app)) + assets = Sprockets::Railtie.config.assets + + assets_javascript = assets.paths.delete(::Rails.root.join('app','assets','javascripts').to_s) + + index_of_last_app_assets = assets.paths.rindex{|s| s.start_with?(::Rails.root.join('app').to_s) } + 1 + assets.paths.insert(index_of_last_app_assets, assets_javascript) if assets_javascript + assets.paths.insert(index_of_last_app_assets, File.join(::Rails.root, config.ember.appkit.paths.config)) + assets.paths.insert(index_of_last_app_assets, File.join(::Rails.root, config.ember.appkit.paths.app)) end end