Class: Decidim::Votings::PollingStation

Inherits:
ApplicationRecord show all
Includes:
FilterableResource, Loggable, Traceable, TranslatableResource
Defined in:
decidim-elections/app/models/decidim/votings/polling_station.rb

Overview

The data store for a PollingStation in the Votings::Voting partecipatory space.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.log_presenter_class_for(_log) ⇒ Object


65
66
67
# File 'decidim-elections/app/models/decidim/votings/polling_station.rb', line 65

def self.log_presenter_class_for(_log)
  Decidim::Votings::AdminLog::PollingStationPresenter
end

Instance Method Details

#closure_for(election) ⇒ Object


61
62
63
# File 'decidim-elections/app/models/decidim/votings/polling_station.rb', line 61

def closure_for(election)
  closures.find_by(election: election)
end

#missing_officers?Boolean

Returns:

  • (Boolean)

53
54
55
# File 'decidim-elections/app/models/decidim/votings/polling_station.rb', line 53

def missing_officers?
  polling_station_president.nil? || polling_station_managers.empty?
end

#slugObject


57
58
59
# File 'decidim-elections/app/models/decidim/votings/polling_station.rb', line 57

def slug
  "polling_station_#{id}"
end