Skip to content

Rails Engine configuration breaks generator or leads to unexpected generator location #314

@braindeaf

Description

@braindeaf

When using the recommended solution for Rails Engines, this breaks the generator in the root application as the location of the generated migration ends up being in. I suspect the behaviour should be if the path is an array then it should use the first path in the list when generating a migration.

/db/data/engine/db/data/engine2/db/data/1212412412_migration.rb

module EngineName
  class Engine < ::Rails::Engine
    initializer :engine_name do |app|
      ::DataMigrate.configure do |data_migrate|
        default_path = ::DataMigrate::Config.new.data_migrations_path
        data_migrate.data_migrations_path = [default_path, root.join('db', 'data')]
      end
    end
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions