has anyone done something like this?
class NilClass def empty?; true; end def strip; nil; end def (s); nil; end end
which is nice so that you can do this without throwing exception: if !params[:something].empty? if !params[:something][:else].strip.empty?
as opposed to this: if params[:something] && !params[:something].empty? if params[:something] && params[:something][:else] && ! params[:something][:else].strip.empty?
It seems to work fine for me so far. I'm just wondering what's the
negative effect of doing that? If not then shouldn't we be doing
this ?
- reynard