Fixed bug where todos got pulled out of tickler too early if user's timezone was behind UTC.

This commit is contained in:
Eric Allen 2008-09-06 17:33:43 -07:00
parent 1d64ca0f34
commit 2c3b3d9d69
2 changed files with 16 additions and 2 deletions

View file

@ -71,8 +71,7 @@ class User < ActiveRecord::Base
:conditions => [ 'state = ?', 'deferred' ],
:order => 'show_from ASC, todos.created_at DESC' do
def find_and_activate_ready
# assumes that active record uses :utc to store datetime in db
find(:all, :conditions => ['show_from <= ?', Time.now.utc ]).collect { |t| t.activate! }
find(:all, :conditions => ['show_from <= ?', proxy_owner.date ]).collect { |t| t.activate! }
end
end
has_many :completed_todos,