app/models/message.rb in hackathon_manager-0.6.5 vs app/models/message.rb in hackathon_manager-0.6.6
- old
+ new
@@ -99,14 +99,20 @@
school_recipients = School.select(:id, :name).map do |school|
option.call("school::#{school.id}", school)
end
# No flatten needed here since each map returns a single option
+ blazer_recipients = Blazer::Query.select(:id, :name).map do |query|
+ option.call("blazer::#{query.id}", query)
+ end
+ # No flatten needed here since each map returns a single option
+
# Combine all recipients. push(*recipients) is the most efficient,
# as it doesn't create a new array each time (concat() does)
recipients = POSSIBLE_SIMPLE_RECIPIENTS.invert.to_a
recipients.push(*bus_list_recipients)
recipients.push(*school_recipients)
+ recipients.push(*blazer_recipients)
# Add current recipients if not included
self.recipients.each do |recipient|
if recipients.none? { |recipient_pair| recipient_pair[1] == recipient }
recipients.push([recipient, recipient])