Last active
August 29, 2015 14:06
-
-
Save maxy/901ca3c35d54e1fec8af to your computer and use it in GitHub Desktop.
Rails Engine モジュールのマイグレーションをRailsアプリケーションに統合する
This file contains 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 EngineModule # Engineモジュール名を設定 | |
class Engine < ::Rails::Engine | |
isolate_namespace EngineModule # Engineモジュール名を設定 | |
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