I know this is dodgy, what would be a nicer way of getting all the unique Volunteer emails that aren't blank (or nil) and putting them in a comma separated list?
Also, my tests seem to have come up okay, but I'm still not certain- will my condition exclude both "" and nil? @message = Message.new(params[:message]) volunteers = Volunteer.find(:all, :conditions => [ "email != ?", "" ], :group => "email" ) recipients = [] volunteers.each do |volunteer| recipients << volunteer.email end @message.recipients = recipients.join(", ") -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---