Could anyone tell me good options for generating search conditions.
Specifically I have parameters based on time (today, yesterday, etc)
and I want a private method in a model to generate a conditions
statement.
The only way I can think to do it is something like :
(pseudocode)
def gen_conditions(part)
if part == “today”
return “submitted at < date”
else if part ==“yesterday”
return “submitted at < date”
end
end
This would probably work, but I’m thinking there might be a better
way. Thanks for any advice.
JB