forked from rubocop/rubocop-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark
Rails/WhereExists
as unsafe auto-correction
## Summary This cop is unsafe because the behavior may change on the following case: ```ruby Author.includes(:articles).where(articles: {id: id}).exists? #=> Perform `eager_load` behaviour (`LEFT JOIN` query) and get result. Author.includes(:articles).exists?(articles: {id: id}) #=> Perform `preload` behaviour and `ActiveRecord::StatementInvalid` error occurs. ``` ## Additional Information And this cop may be considered disabled by default as there is no consensus on the default style. - rubocop#286 - rubocop#342
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters