Sha256: 31e9a2fde6861737c96329613227f4c87b86a0761fa90615af61a0feaad72cff
Contents?: true
Size: 1.07 KB
Versions: 24
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true module Decidim module Votings class BallotStyle < ApplicationRecord belongs_to :voting, foreign_key: :decidim_votings_voting_id, class_name: "Decidim::Votings::Voting" has_many :ballot_style_questions, class_name: "Decidim::Votings::BallotStyleQuestion", foreign_key: :decidim_votings_ballot_style_id, inverse_of: :ballot_style, dependent: :delete_all has_many :questions, through: :ballot_style_questions has_many :census_data, foreign_key: "decidim_votings_ballot_style_id", class_name: "Decidim::Votings::Census::Datum", inverse_of: :ballot_style, dependent: :nullify alias participatory_space voting def slug "#{voting.slug}_#{code.parameterize}-#{id}" end def questions_for(election) questions.where(election: election) end def self.log_presenter_class_for(_log) Decidim::Votings::AdminLog::BallotStylePresenter end end end end
Version data entries
24 entries across 24 versions & 1 rubygems