Hides sidebar menus if officer has no shifts assigned

This commit is contained in:
decabeza
2018-06-19 12:18:48 +02:00
parent 1de0cf083f
commit 16ff5c4400
7 changed files with 74 additions and 18 deletions

View File

@@ -4,4 +4,12 @@ module OfficersHelper
truncate([officer.name, officer.email].compact.join(' - '), length: 100)
end
end
def vote_collection_shift?
current_user.poll_officer.officer_assignments.where(date: Time.current.to_date).any?
end
def final_recount_shift?
current_user.poll_officer.officer_assignments.final.where(date: Time.current.to_date).any?
end
end