A few fixes after more thorough review.

This commit is contained in:
Eric Allen 2008-09-20 17:34:22 -07:00
parent 778427405a
commit f52a2eafa8
7 changed files with 13 additions and 13 deletions

View file

@ -173,7 +173,7 @@ class ApplicationController < ActionController::Base
if show_from_date.nil?
todo.show_from=nil
else
todo.show_from = show_from_date.to_time < Time.now.utc ? nil : show_from_date
todo.show_from = show_from_date < Time.now.utc ? nil : show_from_date
end
saved = todo.save

View file

@ -21,7 +21,7 @@ class Preference < ActiveRecord::Base
def parse_date(s)
return nil if s.blank?
Date.strptime(s, date_format)
user.at_midnight(Date.strptime(s, date_format))
end
end

View file

@ -71,7 +71,7 @@ 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.date ]).collect { |t| t.activate! }
find(:all, :conditions => ['show_from <= ?', Time.now ]).collect { |t| t.activate! }
end
end
has_many :completed_todos,