mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 05:05:18 +01:00
Remove User#at_midnight
Replace it with a class called DateUtils with a method called `#midnight_for` that takes a preference instance and date to convert to midnight.
This commit is contained in:
parent
e7c6142684
commit
a1aaa283f1
6 changed files with 12 additions and 8 deletions
|
|
@ -167,10 +167,6 @@ class User < ActiveRecord::Base
|
|||
time.midnight
|
||||
end
|
||||
|
||||
def at_midnight(date)
|
||||
return ActiveSupport::TimeZone[prefs.time_zone].local(date.year, date.month, date.day, 0, 0, 0)
|
||||
end
|
||||
|
||||
def generate_token
|
||||
self.token = Digest::SHA1.hexdigest "#{Time.now.to_i}#{rand}"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue