Created
January 16, 2019 05:17
-
-
Save jeygeethan/b9a8dc7e2ceecd19b3f09147516fce7c to your computer and use it in GitHub Desktop.
Rails Engine - Load migrate path into the host Rails App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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