Class: Decidim::Follow
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Decidim::Follow
- Includes:
- DataPortability
- Defined in:
- app/models/decidim/follow.rb
Class Method Summary collapse
- .export_serializer ⇒ Object
- .user_collection(user) ⇒ Object
- .user_follower_ids_for_participatory_spaces(spaces) ⇒ Object
Class Method Details
.export_serializer ⇒ Object
22 23 24 |
# File 'app/models/decidim/follow.rb', line 22 def self.export_serializer Decidim::DataPortabilitySerializers::DataPortabilityFollowSerializer 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 29 30 |
# File 'app/models/decidim/follow.rb', line 26 def self.user_follower_ids_for_participatory_spaces(spaces) # IF the space has questions it's a Consultations followables = spaces.flat_map { |space| space.try(:questions) || space } joins(:user).where(followable: followables).pluck(:decidim_user_id).uniq end |