Add Migration Execute Rule#376
Conversation
|
I wonder how common this is. Could we do some checks, e.g. on real-world-rails? The Rails docs show only https://guides.rubyonrails.org/active_record_migrations.html |
The GitHub search: In real-world-rails, when I run I recently implemented this cop for my closed source Rails repo at work, and it is working great! So I decided to upstream it in case others were interested in having it too. In my closed source Rails repo at work (before I implemented the cop),
Yeah, |
Interestingly, when I run This is because of calls like We could possibly make this style guideline / cop more useful if it also caught cases like this. |
|
Much more clear now, thank you. Is it correct to say that Regarding omitting the receiver. How does it work with multi-databases? |
Adds a new rule which recommends using
executeinstead ofconnection.executeinside migrations.I think this rule should exist because
executegives useful terminal output while the migration is running, whereasconnection.executedoes not.Corresponding RuboCop-Rails PR: rubocop/rubocop-rails#1589
Let me know if I should create a corresponding issue on this repo!