Class: Decidim::Votings::PollingOfficer
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- Decidim::Votings::PollingOfficer
- Includes:
- Loggable, Traceable
- Defined in:
- app/models/decidim/votings/polling_officer.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.for(user) ⇒ Object
45 46 47 |
# File 'app/models/decidim/votings/polling_officer.rb', line 45 def self.for(user) where(user:) end |
.log_presenter_class_for(_log) ⇒ Object
60 61 62 |
# File 'app/models/decidim/votings/polling_officer.rb', line 60 def self.log_presenter_class_for(_log) Decidim::Votings::AdminLog::PollingOfficerPresenter end |
.polling_officer?(user) ⇒ Boolean
41 42 43 |
# File 'app/models/decidim/votings/polling_officer.rb', line 41 def self.polling_officer?(user) exists?(user:) end |
Instance Method Details
#polling_station ⇒ Object
56 57 58 |
# File 'app/models/decidim/votings/polling_officer.rb', line 56 def polling_station presided_polling_station || managed_polling_station end |
#role ⇒ Object
49 50 51 52 53 54 |
# File 'app/models/decidim/votings/polling_officer.rb', line 49 def role return :president if presided_polling_station.present? return :manager if managed_polling_station.present? :unassigned end |