From 2f215eab5fca166b8a23c8a0debb24eaa520d725 Mon Sep 17 00:00:00 2001 From: Matthias Viehweger Date: Wed, 11 Dec 2024 17:04:22 +0100 Subject: [PATCH] Give long line a better name --- app/jobs/alumni_mail_job.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/jobs/alumni_mail_job.rb b/app/jobs/alumni_mail_job.rb index 4a9c164..7e79a75 100644 --- a/app/jobs/alumni_mail_job.rb +++ b/app/jobs/alumni_mail_job.rb @@ -12,7 +12,7 @@ def initialize(group_id, person_id) end def perform - return if person.roles.without_alumnus.roles_in_layer(person.id, group.layer_group_id).any? + return if no_more_active_roles? if group.is_a?(Group::Flock) AlumniMailer.new_member_flock(person).deliver_now @@ -23,6 +23,10 @@ def perform private + def no_more_active_roles? + person.roles.without_alumnus.roles_in_layer(person.id, group.layer_group_id).any? + end + def group @group ||= Group.find(@group_id) end