You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Fix#650] Make Rails/CompactBlank aware of delete_if(&:blank)
Fixes#650.
This PR makes `Rails/CompactBlank` aware of `delete_if(&:blank)`.
It is unsafe because `compact_blank!` has different implementations for `Array`, `Hash`,
and `ActionController::Parameters`.
`Array#compact_blank!`, `Hash#compact_blank!` are equivalent to `delete_if(&:blank?)`.
`ActionController::Parameters#compact_blank!` is equivalent to `reject!(&:blank?)`.
If the cop makes a mistake, auto-corrected code may get unexpected behavior.
This PR also updates unsafe document about it.
0 commit comments