lib/rubocop/cop/rails/where_exists.rb in rubocop-rails-2.12.4 vs lib/rubocop/cop/rails/where_exists.rb in rubocop-rails-2.13.0
- old
+ new
@@ -9,19 +9,20 @@
# then the cop enforces `exists?(...)` over `where(...).exists?`.
#
# When EnforcedStyle is 'where' then the cop enforces
# `where(...).exists?` over `exists?(...)`.
#
- # This cop is unsafe for auto-correction because the behavior may change on the following case:
+ # @safety
+ # This cop is unsafe for auto-correction because the behavior may change on the following case:
#
- # [source,ruby]
- # ----
- # Author.includes(:articles).where(articles: {id: id}).exists?
- # #=> Perform `eager_load` behavior (`LEFT JOIN` query) and get result.
+ # [source,ruby]
+ # ----
+ # Author.includes(:articles).where(articles: {id: id}).exists?
+ # #=> Perform `eager_load` behavior (`LEFT JOIN` query) and get result.
#
- # Author.includes(:articles).exists?(articles: {id: id})
- # #=> Perform `preload` behavior and `ActiveRecord::StatementInvalid` error occurs.
- # ----
+ # Author.includes(:articles).exists?(articles: {id: id})
+ # #=> Perform `preload` behavior and `ActiveRecord::StatementInvalid` error occurs.
+ # ----
#
# @example EnforcedStyle: exists (default)
# # bad
# User.where(name: 'john').exists?
# User.where(['name = ?', 'john']).exists?