Class: Decidim::Follow

Inherits:
ApplicationRecord show all
Includes:
DownloadYourData
Defined in:
app/models/decidim/follow.rb

Class Method Summary collapse

Class Method Details

.export_serializerObject



22
23
24
# File 'app/models/decidim/follow.rb', line 22

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

.user_collection(user) ⇒ Object



18
19
20
# File 'app/models/decidim/follow.rb', line 18

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

.user_follower_ids_for_participatory_spaces(spaces) ⇒ Object



26
27
28
# File 'app/models/decidim/follow.rb', line 26

def self.user_follower_ids_for_participatory_spaces(spaces)
  joins(:user).where(followable: spaces).pluck(:decidim_user_id).uniq
end