Sha256: ef76a9c0556977f94c8e7af1bb042c4251af498ecb0c41fc243b1199d8d88cbc
Contents?: true
Size: 796 Bytes
Versions: 13
Compression:
Stored size: 796 Bytes
Contents
# frozen_string_literal: true module Decidim # Defines a relation between a user and an assembly, and what kind of relation # does the user have. class AssemblyUserRole < ApplicationRecord include Traceable include Loggable include ParticipatorySpaceUser belongs_to :assembly, foreign_key: "decidim_assembly_id", class_name: "Decidim::Assembly", optional: true alias participatory_space assembly scope :for_space, ->(participatory_space) { where(assembly: participatory_space) } validates :role, inclusion: { in: ParticipatorySpaceUser::ROLES }, uniqueness: { scope: [:user, :assembly] } def target_space_association = :assembly def self.log_presenter_class_for(_log) Decidim::Assemblies::AdminLog::AssemblyUserRolePresenter end end end
Version data entries
13 entries across 13 versions & 1 rubygems