Skip to content

Commit d62a8a9

Browse files
Add select for member != nil
1 parent 1c75abe commit d62a8a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/controllers/admin/payments_controller.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def index
3030
@late_activities = Activity.debtors.select do |activity|
3131
(Date.today.prev_occurring(:friday) - activity.payable_updated_at).to_i >= 21 && activity.is_payable
3232
end
33+
3334
@late_payments =
3435
@late_activities.map do |activity|
3536
activity.attendees.select do |participant|
@@ -39,7 +40,9 @@ def index
3940
(participant.price.nil? &&
4041
activity.price && activity.price > 0)
4142
)
42-
end.map(&:member)
43+
# Somehow there were `nil` members in this list, not sure how we got there,
44+
# but the `select` makes the page useable.
45+
end.map(&:member).select{ |member| member != nil }
4346
end.flatten.uniq
4447
@late_unpayable_activities = Activity.late_unpayable
4548
end

0 commit comments

Comments
 (0)