Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
braindeaf opened this issue Jul 16, 2024 · 1 comment

Comments

@braindeaf
Copy link

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
@bruno-costanzo
Copy link
Collaborator

I will see this tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants