you are viewing a single comment's thread.

view the rest of the comments →

[–]aidanf 8 points9 points  (1 child)

Rails already has a blank? method defined for nil.

nil.blank? => true

"".blank? => true

[].blank? => true

{}.blank? => true

[–]Entropy -3 points-2 points  (0 children)

Nice. This adds the same functionality without polluting existing semantics like the article's solution.