Reputation: 45335
time_shift = DateTime.now - 75000
@user.items.where(:updated_at < time_shift) { |item|
I get error
comparison of Symbol with DateTime failed
Why and how to fix it?
In model:
t.datetime "updated_at"
Upvotes: 3
Views: 3455
Reputation: 184
John's answer doesn't seems to work with PostgreSQL. If you are using PostgreSQL use:
@user.items.where('"users"."updated_at" < ?', time_shift)
Upvotes: 0