Sha256: d20d2c044dba03ccb76743a38f2d74b6aa2db4cf16da20d2eb1e6a8db4f99c67
Contents?: true
Size: 845 Bytes
Versions: 14
Compression:
Stored size: 845 Bytes
Contents
# frozen_string_literal: true module Decidim module Consultations # The data store for question's votes in the Decidim::Consultations component. class Vote < ApplicationRecord include Authorable belongs_to :question, foreign_key: "decidim_consultation_question_id", class_name: "Decidim::Consultations::Question", counter_cache: :votes_count, inverse_of: :votes belongs_to :response, foreign_key: "decidim_consultations_response_id", class_name: "Decidim::Consultations::Response", inverse_of: :votes, counter_cache: :votes_count validates :author, uniqueness: { scope: [:decidim_user_group_id, :question] } delegate :organization, to: :question end end end
Version data entries
14 entries across 14 versions & 1 rubygems