Sha256: f1427b31cfeb3edd1b4e3f8d579d812fb6b54df0f74fdb1842659989bc606b0a

Contents?: true

Size: 956 Bytes

Versions: 13

Compression:

Stored size: 956 Bytes

Contents

# frozen_string_literal: true

module Decidim
  # This class gives a given User access to a given private ParticipatorySpacePrivateUser
  class ParticipatorySpacePrivateUser < ApplicationRecord
    include Decidim::DownloadYourData
    include ParticipatorySpaceUser

    belongs_to :privatable_to, polymorphic: true

    scope :by_participatory_space, ->(privatable_to) { where(privatable_to_id: privatable_to.id, privatable_to_type: privatable_to.class.to_s) }

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

    def self.export_serializer
      Decidim::DownloadYourDataSerializers::DownloadYourDataParticipatorySpacePrivateUserSerializer
    end

    def self.log_presenter_class_for(_log)
      Decidim::AdminLog::ParticipatorySpacePrivateUserPresenter
    end

    ransacker :invitation_sent_at do
      Arel.sql(%{("invitation_sent_at")::text})
    end

    def target_space_association = :privatable_to
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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