This project is archived and is in readonly mode.

#5831 new
Peer Allan

Rails Upgrade plugin loses found results after a comment

Reported by Peer Allan | October 17th, 2010 @ 08:01 PM

In our app we used the rails_upgrade plugin to find what we needed to fix. We found that the rails:upgrade:check rake task was missing many of our named_scopes. It turns out that the grep command is being scrubbed by gsub and that if the first line in the results was a comment, then all subsequent lines were lost. For example,

Grep results:

/path/to/app/models/article.rb: # named_scope :active /path/to/app/models/article.rb: named_scope :inactive /path/to/app/models/post.rb: named_scope :by_author

You would expect the upgrade to skip the first line and report the second and third line, but at present it returns no results. The attached patch fixes this.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Pages