app/commands/decidim/meetings/join_meeting.rb in decidim-meetings-0.20.1 vs app/commands/decidim/meetings/join_meeting.rb in decidim-meetings-0.21.0
- old
+ new
@@ -31,10 +31,11 @@
send_email_confirmation
send_notification_confirmation
notify_admin_over_percentage
increment_score
end
+ follow_meeting
broadcast(:ok)
end
private
@@ -102,9 +103,19 @@
)
end
def increment_score
Decidim::Gamification.increment_score(user, :attended_meetings)
+ end
+
+ def follow_meeting
+ Decidim::CreateFollow.call(follow_form, user)
+ end
+
+ def follow_form
+ Decidim::FollowForm
+ .from_params(followable_gid: meeting.to_signed_global_id.to_s)
+ .with_context(current_user: user)
end
def occupied_slots_over?(percentage)
@meeting.remaining_slots == (@meeting.available_slots * (1 - percentage)).round
end