Comparing timestamps without milliseconds

2016-09-07 Thread Trevor Turk
Hello, I ran into a problem where I'm trying to compare two timestamps, one of which is an updated_at timestamp that is automatically set when a record is marked as processed, to use my app's domain language. So, this query returns too many records: Person.where('updated_at > processed_at') I

Re: Comparing timestamps without milliseconds

2016-09-07 Thread Jeremy Evans
On Wednesday, September 7, 2016 at 8:32:51 AM UTC-7, Trevor Turk wrote: > > Hello, > > I ran into a problem where I'm trying to compare two timestamps, one of > which is an updated_at timestamp that is automatically set when a record is > marked as processed, to use my app's domain language. So,

Re: Comparing timestamps without milliseconds

2016-09-07 Thread Trevor Turk
On Wednesday, September 7, 2016 at 1:29:43 PM UTC-5, Jeremy Evans wrote: > > In general, I recommend using CURRENT_TIMESTAMP in queries instead of > literal timestamp values representing the current timestamp (which is what > you get if you use Time.now.utc). I'm guessing you are using the > t