mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-26 00:54:08 +01:00
Replace User#time with UserTime#time
This commit is contained in:
parent
8512e8db3b
commit
96777c2e3a
13 changed files with 44 additions and 27 deletions
|
|
@ -99,9 +99,10 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def needs_review?(current_user)
|
||||
def needs_review?(user)
|
||||
current_time = UserTime.new(user).time
|
||||
return active? && ( last_reviewed.nil? ||
|
||||
(last_reviewed < current_user.time - current_user.prefs.review_period.days))
|
||||
(last_reviewed < current_time - user.prefs.review_period.days))
|
||||
end
|
||||
|
||||
def blocked?
|
||||
|
|
|
|||
|
|
@ -159,10 +159,6 @@ class User < ActiveRecord::Base
|
|||
save!
|
||||
end
|
||||
|
||||
def time
|
||||
Time.now.in_time_zone(prefs.time_zone)
|
||||
end
|
||||
|
||||
def date
|
||||
UserTime.new(self).midnight(Time.now)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue