hi, i think "Chronic" is the library you''re looking for.
check it at :
http://chronic.rubyforge.org/
On Nov 18, 11:20 pm, Jables
<brun3...-Meo6Lv8EUjg3uPMLIKxrzw@public.gmane.org>
wrote:> 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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---