Commit 53580b9
fix: correct Object#blank? and Object#present? polyfill implementations
Object#blank? was `!self`, ignoring objects that respond to empty?. Should
be `respond_to?(:empty?) ? !!empty? : !self` to match active_support.
Object#present? was `!!self`, which is always true for any non-nil/non-false
object regardless of blank? — inconsistent with classes that override blank?.
Should be `!blank?`.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 8a1273c commit 53580b9
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments