Rails 3 - Time Comparison?

I am working on the following in my Rails application:

if record.updated_at> 15.minutes.ago do something end

Meaning ... If record.updated_at was more than 15 minutes ago, do something ...

This does not work. Ideas?

+5
source share
2 answers

Do you want to:

if record.updated_at < 15.minutes.ago

It is less than before.

+13
source

, , , . 15.minutes.ago , record.updated_at. , ", ", ? , , . , , .

+1

All Articles