Sha256: d36595997ef79e53f634956ddc21923d69280397b7267cd24497dc1d20ab58dd

Contents?: true

Size: 691 Bytes

Versions: 3

Compression:

Stored size: 691 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Meetings
    # The data store for a Registration in the Decidim::Meetings component.
    class Registration < Meetings::ApplicationRecord
      include Decidim::DataPortability

      belongs_to :meeting, foreign_key: "decidim_meeting_id", class_name: "Decidim::Meetings::Meeting"
      belongs_to :user, foreign_key: "decidim_user_id", class_name: "Decidim::User"

      validates :user, uniqueness: { scope: :meeting }

      def self.user_collection(user)
        where(decidim_user_id: user.id)
      end

      def self.export_serializer
        Decidim::Meetings::DataPortabilityRegistrationSerializer
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
decidim-meetings-0.13.1 app/models/decidim/meetings/registration.rb
decidim-meetings-0.13.0 app/models/decidim/meetings/registration.rb
decidim-meetings-0.13.0.pre1 app/models/decidim/meetings/registration.rb