Migrations in Rails Engine?

前端 未结 6 1620
暗喜
暗喜 2020-12-12 14:48

I have multiple rails applications talking to the same backend and I\'d like them to share some migrations.
I setup a rails engine (with enginex), I can share anything (

6条回答
  •  忘掉有多难
    2020-12-12 15:01

    For rails 4 use:

       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
    

    https://content.pivotal.io/blog/leave-your-migrations-in-your-rails-engines

提交回复
热议问题