Sha256: aabb9e455693164bd29abd68d090a5d6866bb830d2ca72ea0f4062c1ca4f72b5

Contents?: true

Size: 714 Bytes

Versions: 25

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Messaging
    #
    # Holds a many-to-many relationship between conversations and their participants
    #
    class Participation < ApplicationRecord
      self.table_name = "decidim_messaging_participations"

      belongs_to :conversation,
                 foreign_key: :decidim_conversation_id,
                 class_name: "Decidim::Messaging::Conversation",
                 inverse_of: :participations

      belongs_to :participant,
                 foreign_key: :decidim_participant_id,
                 class_name: "Decidim::UserBaseEntity"

      validates :decidim_conversation_id, uniqueness: { scope: :decidim_participant_id }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/models/decidim/messaging/participation.rb
decidim-core-0.28.4 app/models/decidim/messaging/participation.rb
decidim-core-0.27.9 app/models/decidim/messaging/participation.rb
decidim-core-0.29.0 app/models/decidim/messaging/participation.rb
decidim-core-0.28.3 app/models/decidim/messaging/participation.rb
decidim-core-0.27.8 app/models/decidim/messaging/participation.rb
decidim-core-0.29.0.rc4 app/models/decidim/messaging/participation.rb
decidim-core-0.29.0.rc3 app/models/decidim/messaging/participation.rb
decidim-core-0.29.0.rc2 app/models/decidim/messaging/participation.rb
decidim-core-0.29.0.rc1 app/models/decidim/messaging/participation.rb
decidim-core-0.28.2 app/models/decidim/messaging/participation.rb
decidim-core-0.27.7 app/models/decidim/messaging/participation.rb
decidim-core-0.28.1 app/models/decidim/messaging/participation.rb
decidim-core-0.27.6 app/models/decidim/messaging/participation.rb
decidim-core-0.28.0 app/models/decidim/messaging/participation.rb
decidim-core-0.27.5 app/models/decidim/messaging/participation.rb
decidim-core-0.28.0.rc5 app/models/decidim/messaging/participation.rb
decidim-core-0.28.0.rc4 app/models/decidim/messaging/participation.rb
decidim-core-0.27.4 app/models/decidim/messaging/participation.rb
decidim-core-0.27.3 app/models/decidim/messaging/participation.rb