Class: Decidim::ParticipatorySpacePrivateUser

Inherits:
ApplicationRecord show all
Includes:
DownloadYourData, ParticipatorySpaceUser, TranslatableResource
Defined in:
decidim-core/app/models/decidim/participatory_space_private_user.rb

Overview

This class gives a given User access to a given private ParticipatorySpacePrivateUser

Constant Summary

Constants included from ParticipatorySpaceUser

Decidim::ParticipatorySpaceUser::ROLES

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.export_serializerObject



23
24
25
# File 'decidim-core/app/models/decidim/participatory_space_private_user.rb', line 23

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

.log_presenter_class_for(_log) ⇒ Object



27
28
29
# File 'decidim-core/app/models/decidim/participatory_space_private_user.rb', line 27

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

.ransackable_associations(_auth_object = nil) ⇒ Object



41
42
43
# File 'decidim-core/app/models/decidim/participatory_space_private_user.rb', line 41

def self.ransackable_associations(_auth_object = nil)
  %w(user)
end

.ransackable_attributes(auth_object = nil) ⇒ Object



35
36
37
38
39
# File 'decidim-core/app/models/decidim/participatory_space_private_user.rb', line 35

def self.ransackable_attributes(auth_object = nil)
  return [] unless auth_object&.admin?

  %w(name nickname email invitation_accepted_at last_sign_in_at invitation_sent_at role)
end

.user_collection(user) ⇒ Object



19
20
21
# File 'decidim-core/app/models/decidim/participatory_space_private_user.rb', line 19

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

Instance Method Details

#target_space_associationObject



45
# File 'decidim-core/app/models/decidim/participatory_space_private_user.rb', line 45

def target_space_association = :privatable_to