My question is sort of like the one found here:
How to compare sqlite TIMESTAMP values
Except that the answer doesn't work for PostgreSQL. Is there any way to compare two created_at values made by Rails with a PG function?
Here's what I want to do (I know this doesn't work, DATETIME doesn't work for PG):
EventDish.find_by_sql(["select * from ............. and DATETIME(events.created_at) < ?", other_event.created_at])
With the ellipses added to highlight the important part. In other words, I want to compare two Rails created_at fields (these are using whatever the default is), but I want to compare them with PG. Any suggestions? (I'm not too familiar with SQL in general, so any pure Rails solutions would also be appreciated)
Thanks in advance