Sha256: 0b8165d1a3ab806baabe7a36a1694db8caf36457be524b864f72cd1aa8ede914
Contents?: true
Size: 633 Bytes
Versions: 39
Compression:
Stored size: 633 Bytes
Contents
# frozen_string_literal: true module Decidim module Elections # The data store for a Vote in the Decidim::Election component. It stores the hash computed from the `encrypted_vote` associated to a particular `voter_id`. class Vote < ApplicationRecord enum status: [:pending, :accepted, :rejected].index_with(&:to_s) belongs_to :election, foreign_key: "decidim_elections_election_id", class_name: "Decidim::Elections::Election" belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User", optional: true validates :voter_id, :encrypted_vote_hash, presence: true end end end
Version data entries
39 entries across 39 versions & 1 rubygems