Sha256: 9eaed55ef6c993b0fd8c2a8a64872991ea59fdaefff76aa36f061423792574c7
Contents?: true
Size: 657 Bytes
Versions: 8
Compression:
Stored size: 657 Bytes
Contents
# frozen_string_literal: true module Decidim module Admin # Defines a relation between a user and a participatory process, and what # kind of relation does the user has. class ParticipatoryProcessUserRole < ApplicationRecord belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User", optional: true belongs_to :participatory_process, foreign_key: "decidim_participatory_process_id", class_name: "Decidim::ParticipatoryProcess", optional: true ROLES = %w(admin collaborator).freeze validates :role, inclusion: { in: ROLES }, uniqueness: { scope: [:user, :participatory_process] } end end end
Version data entries
8 entries across 8 versions & 2 rubygems