This addresses several problems I ran into when testing this manually:
SortingHat::Finder#groups returned either a group or an array of groups, now it is always an Array
SortingHat::Song#notify_layer_admins did more than I could comprehend. There I split it into two methods. After doing that, I saw that I could change the loop to not loop over Person-instances, but extract the emails and just loop over those.
This addresses several problems I ran into when testing this manually:
SortingHat::Finder#groups
returned either a group or an array of groups, now it is always an ArraySortingHat::Song#notify_layer_admins
did more than I could comprehend. There I split it into two methods. After doing that, I saw that I could change the loop to not loop overPerson
-instances, but extract the emails and just loop over those.