I have discovered that unlike the other parts of the migrations system, the 
Migration::CheckPending Rack module does not respect 
`Rails.application.paths['db/migrate']`.

All the rake-driven migrations code benefits from: 
active_record/railties/databases.rake#L6 
<https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railties/databases.rake#L6>

ActiveRecord::Migrator.migrations_paths = ActiveRecord::Tasks::DatabaseTasks
.migrations_paths

DatabaseTasks.migration_paths returns the value of 
Rails.application.paths['db/migrate'].

However Migration::CheckPending does not benefit from this.

I've been experimenting with ways to fix it, for example this works:

class CheckPending

  def initialize(app)
    ...
    if defined? Rails
      ActiveRecord::Migrator.migrations_paths = Rails.application.paths[
'db/migrate'].to_a 
    end
  end

Does this look like a viable solution?
Is it something that might ever get merged in?
This is a somewhat unusual situation.  I'm doing some experiments on 
engines/apps, attempting to change their relationships to each other, and 
discovered this when I moved the migrations folder.
Should I spin up a PR?

Thanks for your consideration,

-Sam.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to