Sha256: b29d9255afe72660ef615789490d1989955b78e2d17634b40549ace4e75d587e

Contents?: true

Size: 816 Bytes

Versions: 13

Compression:

Stored size: 816 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # Defines a relation between a user and a Conference, and what kind of relation
  # does the user have.
  class ConferenceUserRole < ApplicationRecord
    include Traceable
    include Loggable
    include ParticipatorySpaceUser

    belongs_to :conference, foreign_key: "decidim_conference_id", class_name: "Decidim::Conference", optional: true
    alias participatory_space conference

    scope :for_space, ->(participatory_space) { where(conference: participatory_space) }

    validates :role, inclusion: { in: ParticipatorySpaceUser::ROLES }, uniqueness: { scope: [:user, :conference] }
    def target_space_association = :conference

    def self.log_presenter_class_for(_log)
      Decidim::Conferences::AdminLog::ConferenceUserRolePresenter
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
decidim-conferences-0.29.1 app/models/decidim/conference_user_role.rb
decidim-conferences-0.28.4 app/models/decidim/conference_user_role.rb
decidim-conferences-0.29.0 app/models/decidim/conference_user_role.rb
decidim-conferences-0.28.3 app/models/decidim/conference_user_role.rb
decidim-conferences-0.29.0.rc4 app/models/decidim/conference_user_role.rb
decidim-conferences-0.29.0.rc3 app/models/decidim/conference_user_role.rb
decidim-conferences-0.29.0.rc2 app/models/decidim/conference_user_role.rb
decidim-conferences-0.29.0.rc1 app/models/decidim/conference_user_role.rb
decidim-conferences-0.28.2 app/models/decidim/conference_user_role.rb
decidim-conferences-0.28.1 app/models/decidim/conference_user_role.rb
decidim-conferences-0.28.0 app/models/decidim/conference_user_role.rb
decidim-conferences-0.28.0.rc5 app/models/decidim/conference_user_role.rb
decidim-conferences-0.28.0.rc4 app/models/decidim/conference_user_role.rb