I wrote that code. Can you give me a PR with tests? Mention @schneems


—
Sent from Mailbox

On Sun, May 24, 2015 at 2:09 PM, Sam Pierson <[email protected]>
wrote:

> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To post to this group, send email to [email protected].
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