On Jun 8, 5:11 am, "J. D." <rails-mailing-l...@andreas-s.net> wrote:
> Hi Fred,
>
> I think I will use this for my find parameter:
>
> start_date = Time.now.beginning_of_week
>     end_date = Time.now.end_of_week
>     @rushing_offenses = RushingOffense.find(:all, :conditions =>
> ['created_at > ? and created_at < ?', start_date, end_date])
>
> That will let me find anything created within the set week.  Now I just
> have to figure out how to check whether or not it returns nil and create
> data..

It will never return nil. It will return an array (possibly an empty
one). You might want to set your own timestamp and use that rather
than relying on created at (so that the date is one that is
significant to your data and not just when you happened to run your
scraper)

Fred
>
> --
> 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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to