29 ms·
Most often I do var_that_might_be_nil.presence || default reads better imo
by sethrin 3y ago
Most often I do
var_that_might_be_nil.presence || default
reads better imo
- vidarh 3y ago"presence" isn't Ruby, but Rails/ActiveSupport and your example acts very differently in the case of empty strings, empty arrays, hashes etc..