Skip to content

Instantly share code, notes, and snippets.

@maxy
Last active August 29, 2015 14:06
Show Gist options
  • Save maxy/901ca3c35d54e1fec8af to your computer and use it in GitHub Desktop.
Save maxy/901ca3c35d54e1fec8af to your computer and use it in GitHub Desktop.
Rails Engine モジュールのマイグレーションをRailsアプリケーションに統合する
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