Tuesday, November 27, 2012

[Rails] Re: Unique constraint on a date looks for previous day

comopasta Gr wrote in post #1086663:

> If the related_date is 2012-11-23 I can see form the logs that the check
> for the existing value is actually looking for the 22nd
>
> (DEBUG) 15489 Kpivalue Exists (0.4ms) SELECT 1 FROM "kpivalues" WHERE
> ("kpivalues"."related_date" = '2012-11-22 22:00:00.000000' AND
> "kpivalues"."indicator_id" = 1485 AND "kpivalues"."edone_id" IS NULL)
> LIMIT 1

Well I can see the 2012-11-22 22:00:00.000000 is the UTC date of
2012-11-23 00:00:00 in my timezone. So I guess I need to pass the date
considering time difference. Not sure which one yet.

--
Posted via http://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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate