Permalink
Browse files

Let the engine ensure that it's migrations are run on initialization.

  • Loading branch information...
1 parent b981bb9 commit bd8a6a8869e67785d71ef3fdc2bf7ed240f21ad9 Stephan Hagemann committed Sep 25, 2012
Showing with 3 additions and 3 deletions.
  1. +0 −2 config/application.rb
  2. +3 −1 engines/teaser/lib/teaser/engine.rb
View
@@ -18,8 +18,6 @@
module TheNextBigThing
class Application < Rails::Application
- config.paths['db/migrate'] += Teaser::Engine.paths['db/migrate']
-
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
@@ -2,6 +2,8 @@ module Teaser
class Engine < ::Rails::Engine
isolate_namespace Teaser
- config.paths['db/migrate'] << File.join(Teaser::Engine.paths['db/migrate'].first)
+ initializer :append_migrations do |app|
+ app.config.paths["db/migrate"] += config.paths["db/migrate"].expanded unless app.root.to_s.match root.to_s
+ end
end
end

0 comments on commit bd8a6a8

Please sign in to comment.