Sha256: 70fa13858fbb763faddcb267476c124c0be5442099d511148a750c5911bd1194

Contents?: true

Size: 990 Bytes

Versions: 45

Compression:

Stored size: 990 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Consultations
    class Response < ApplicationRecord
      include Decidim::TranslatableResource

      translatable_fields :title

      belongs_to :question,
                 foreign_key: "decidim_consultations_questions_id",
                 class_name: "Decidim::Consultations::Question",
                 counter_cache: :responses_count,
                 inverse_of: :responses

      has_many :votes,
               foreign_key: "decidim_consultations_response_id",
               class_name: "Decidim::Consultations::Vote",
               inverse_of: :response,
               dependent: :restrict_with_error

      belongs_to :response_group,
                 foreign_key: "decidim_consultations_response_group_id",
                 class_name: "Decidim::Consultations::ResponseGroup",
                 inverse_of: :responses,
                 counter_cache: :responses_count,
                 optional: true
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
decidim-consultations-0.27.9 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.8 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.7 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.6 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.10 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.9 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.5 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.8 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.4 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.3 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.7 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.5 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.2 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.1 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.4 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.0 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.3 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.0.rc2 app/models/decidim/consultations/response.rb
decidim-consultations-0.27.0.rc1 app/models/decidim/consultations/response.rb
decidim-consultations-0.26.2 app/models/decidim/consultations/response.rb