Skip to content

Instantly share code, notes, and snippets.

@jeygeethan
Created January 16, 2019 05:17
Show Gist options
  • Save jeygeethan/b9a8dc7e2ceecd19b3f09147516fce7c to your computer and use it in GitHub Desktop.
Save jeygeethan/b9a8dc7e2ceecd19b3f09147516fce7c to your computer and use it in GitHub Desktop.
Rails Engine - Load migrate path into the host Rails App
module MyEngine
class Engine < ::Rails::Engine
isolate_namespace MyEngine
initializer :append_migrations do |app|
unless app.root.to_s.match root.to_s
config.paths["db/migrate"].expanded.each do |expanded_path|
app.config.paths["db/migrate"] << expanded_path
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment