lib/ember/appkit/rails/engine.rb in ember-appkit-rails-0.4.0 vs lib/ember/appkit/rails/engine.rb in ember-appkit-rails-0.5.0
- old
+ new
@@ -18,10 +18,11 @@
::Rails::Generators.configure!(app.config.generators)
::Rails::Generators.hidden_namespaces.uniq!
require 'generators/ember/resource_override'
require 'generators/ember/scaffold_override'
require 'generators/ember/scaffold_controller_override'
+ require 'generators/ember/serializer_override'
end
initializer :appkit_transpiler do
config.ember.prefix_patterns.app ||= Regexp.new(File.join(::Rails.root, config.ember.namespaces.app))
config.ember.prefix_patterns.config ||= Regexp.new(File.join(::Rails.root, config.ember.namespaces.config))
@@ -55,16 +56,20 @@
app.routes.append do
get '/' => "landing#index"
end
end
+ initializer :appkit_serializer, before: :set_autoload_paths do |app|
+ app.config.paths.add File.join(Rails.root, 'config/serializers'), eager_load: true
+ end
+
initializer :appkit_sprockets do
assets = Sprockets::Railtie.config.assets
precompile_index = config.assets.precompile.index { |i| i =~ File.join(Rails.root, 'app/assets/javascripts/application.js') }
config.assets.precompile[precompile_index] = /(?<!assets\/javascripts)(?:\/|\\|\A)application\.(css|js)$/
- assets_javascript = assets.paths.delete(::Rails.root.join('app','assets','javascripts').to_s)
+ assets.paths.delete(::Rails.root.join('app','assets','javascripts').to_s)
assets.paths.delete(::Rails.root.join('lib', 'assets','javascript').to_s)
index_of_last_app_assets = assets.paths.rindex { |path| path.to_s.start_with?(::Rails.root.join('app').to_s) } + 1
assets.paths.insert(index_of_last_app_assets, File.join(::Rails.root, 'lib'))
assets.paths.insert(index_of_last_app_assets, File.join(::Rails.root, config.ember.paths.app))