From 4ac09ed3ae391672f4077c0991b0bb8fc6424756 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Mon, 25 Aug 2008 17:20:27 +0200 Subject: [PATCH] hopefully fix time that a todo comes from tickler assumes the datetime in db is in utc --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 8afb8e41..b49db26c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -71,7 +71,8 @@ class User < ActiveRecord::Base :conditions => [ 'state = ?', 'deferred' ], :order => 'show_from ASC, todos.created_at DESC' do def find_and_activate_ready - find(:all, :conditions => ['show_from <= ?', proxy_owner.time ]).collect { |t| t.activate! } + # assumes that active record uses :utc to store datetime in db + find(:all, :conditions => ['show_from <= ?', Time.now.utc ]).collect { |t| t.activate! } end end has_many :completed_todos,