Yes it does but it makes me a sad panda.

Carl Woodward
0412218979
[email protected]



On Wed, Oct 7, 2009 at 11:48 AM, Lawrence Pit <[email protected]> wrote:
>
> Yeah, so the solution I suggested was:
>
>
>    Event.all(:conditions => ["scheduled_at BETWEEN ? AND ?",
> zoned_time.beginning_of_day.utc,
> zoned_time.end_of_day.utc]).length.should.equal 2
>
>
>
> LP
>
> Yeh it doesn't pass. That is the test that we need to get passing.
>
> We have test the extremities to ensure that the code will handle time
> zoned times.
>
> Let me know your thoughts?
>
>
> Carl Woodward
> 0412218979
> [email protected]
>
>
>
> On Wed, Oct 7, 2009 at 11:30 AM, Lawrence Pit <[email protected]>
> wrote:
>
>
> Does that actually pass for you? For me it finds one event, not two.
>
>
>
>
>
> Cheers,
> Lawrence
>
> Hey guys,
>
> We have done another test. It is taken off Tim's code but a more
> succinct example.
>
> https://gist.github.com/7a512dbfa945af6409b4
>
> Please let me know your thoughts?
>
> Thanks again,
> Carl.
>
> Carl Woodward
> 0412218979
> [email protected]
>
>
>
> On Wed, Oct 7, 2009 at 10:54 AM, Lawrence Pit <[email protected]>
> wrote:
>
>
> Also for date(created_at + interval '10 hours') ?
>
> LP
>
> On 07/10/2009, at 9:08 AM, Lawrence Pit <[email protected]> wrote:
>
>
>
> Both these queries will suck if you have loads of articles, as the
> function use of +date+ will prohibit the use of an index on
> created_at.
>
> Use the BETWEEN ... AND ... syntax instead, using beginning and end of
> day of local time converted to utc.
>
>
> Not true for PostgreSQL, you can create an index of date(scheduled_at)
>
> -- tim
>
>
>
>
>
>
>
>
>
>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to