Switch all Time.curren.to_date for Date.current, same result but better syntax
This commit is contained in:
@@ -26,7 +26,7 @@ class Officing::ResidenceController < Officing::BaseController
|
||||
@officer_assignments = current_user.poll_officer.
|
||||
officer_assignments.
|
||||
voting_days.
|
||||
where(date: Time.current.to_date)
|
||||
where(date: Date.current)
|
||||
end
|
||||
|
||||
def validate_officer_assignment
|
||||
|
||||
@@ -50,7 +50,7 @@ class Poll
|
||||
if dob.blank?
|
||||
nil
|
||||
else
|
||||
now = Time.current.to_date
|
||||
now = Date.current
|
||||
now.year - dob.year - (now.month > dob.month || (now.month == dob.month && now.day >= dob.day) ? 0 : 1)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user