Ruby on Rails Tuesday, September 18, 2018

Hi, I defined time like this --->

  require 'time'

    todaydate = Time.new

    todaydate = todaydate.year.to_s + "-" + todaydate.month.to_s + "-" + todaydate.day.to_s

and the column for enddate is a date type.   It had worked previously, I just updated the dates in a populate rake file and stopped working (on the development env (sqlite)).

Thanks,
Joe

On Monday, September 17, 2018 at 7:34:00 PM UTC-4, Hassan Schroeder wrote:
On Mon, Sep 17, 2018 at 1:20 PM, Joe Guerra <JGu...@jginfosys.com> wrote:
> I have an active record query (for my categories) that check for the date (
> .where( 'enddate > ?', todaydate )).
>
> Today's date get's wrapped in quotes, and it fails to produce any records,
> but it's perfectly fine in postgres.

What exactly is "todaydate"? What's the column definition of "enddate"?

And are you sure you have identical records in both DBs you're testing
this with?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d273f500-5d2c-47fe-beeb-57ad4d280560%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment