You want to use a BETWEEN query using something like
Time#beginning_of_week and Time#next_week documented at http://
api.rubyonrails.com/classes/ActiveSupport/CoreExtensions/Time/
Calculations.html#M000338.
-Bill Siggelkow
http://www.jadecove.com
On Feb 7, 8:54 am, Mike Dershowitz
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:> Hello:
>
> I have some data in my database that is updated daily. When i present
> this data to the
>
> user, however, I want them to see only the data for the week that they
> are currently in.
>
> Each row in the table in which the data resides has a timestamp, so
it''s
> no trouble finding
>
> out when the row was inserted, it''s just trouble finding out how
to
> create a query based on
>
> a time of now when now is used only to figure out the week we''re
in.
>
> Does rails have something built-in for this? I assume this is something
> I would put in my
>
> model and then use in my query in my controller or view?
>
> Thanks very much in advance for your help.
>
> Mike
>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---