Sha256: 45e85e454ef4e7c08c3a682e5fcc787274deaf571b44b670d7562af2fb3107f6
Contents?: true
Size: 630 Bytes
Versions: 3
Compression:
Stored size: 630 Bytes
Contents
# frozen_string_literal: true module Decidim # 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 moderator).freeze validates :role, inclusion: { in: ROLES }, uniqueness: { scope: [:user, :participatory_process] } end end
Version data entries
3 entries across 3 versions & 1 rubygems