Sha256: 43a01e064c9e97cdc44eb884664f07fcc05bb6237235be32cb07dffb0985b3fd

Contents?: true

Size: 921 Bytes

Versions: 6

Compression:

Stored size: 921 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ReportingProposals
    module ParticipatorySpaceUserRoleOverride
      extend ActiveSupport::Concern

      included do
        has_many :category_valuators,
                 class_name: "Decidim::ReportingProposals::CategoryValuator",
                 foreign_key: :valuator_role_id,
                 dependent: :destroy

        # there is a bug in decidim that does not clean records from ValuationAssignment when removing Space roles
        # This is a workaround to clean them manually
        # It might be possible that we need to change this when this is solved:
        # https://github.com/decidim/decidim/issues/10353
        has_many :proposal_valuation_assignments,
                 class_name: "Decidim::Proposals::ValuationAssignment",
                 foreign_key: :valuator_role_id,
                 dependent: :destroy
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-reporting_proposals-0.6.0 app/models/concerns/decidim/reporting_proposals/participatory_space_user_role_override.rb
decidim-reporting_proposals-0.5.2 app/models/concerns/decidim/reporting_proposals/participatory_space_user_role_override.rb
decidim-reporting_proposals-0.5.1 app/models/concerns/decidim/reporting_proposals/participatory_space_user_role_override.rb
decidim-reporting_proposals-0.5.0 app/models/concerns/decidim/reporting_proposals/participatory_space_user_role_override.rb
decidim-reporting_proposals-0.4.2 app/models/concerns/decidim/reporting_proposals/participatory_space_user_role_override.rb
decidim-reporting_proposals-0.2.0 app/models/concerns/decidim/reporting_proposals/participatory_space_user_role_override.rb