rename DateUtils to UserTime

This commit is contained in:
Matt Rogers 2013-07-29 21:51:15 -05:00
parent 6c695aa61a
commit 8512e8db3b
6 changed files with 18 additions and 9 deletions

View file

@ -22,6 +22,6 @@ class Preference < ActiveRecord::Base
raise ArgumentError.new("Bad argument type:#{s.class}")
end
DateUtils::midnight_for(self, date)
UserTime.new(user).midnight(date)
end
end

View file

@ -260,7 +260,7 @@ class Todo < ActiveRecord::Base
activate
else
# parse Date objects into the proper timezone
date = DateUtils.midnight_for(user.prefs, date) if (date.is_a? Date)
date = UserTime.new(user).midnight(date) if (date.is_a? Date)
# show_from needs to be set before state_change because of "bug" in aasm.
# If show_from is not set, the todo will not validate and thus aasm will not save

View file

@ -164,7 +164,7 @@ class User < ActiveRecord::Base
end
def date
time.midnight
UserTime.new(self).midnight(Time.now)
end
def generate_token