2 ms·
I'd argue that it's really two functions: * One to do the lookup and potentially explode; this always takes an argument. * A second to provide the default. H
by damncabbage 14y ago
I'd argue that it's really two functions:
* One to do the lookup and potentially explode; this always takes an argument.
* A second to provide the default.
Have the caller call the appropriate one. User provides params[:search] (or some other "explicitly trying to search"), then call the first. If not, call the latter.