Reformatted excerpts from Guillaume Quintard's message of 2009-09-26:
> message.recipients.each {
> |person|
> if (person.email =~ /[email protected]/) != nil
> Person.from_address "Foo <[email protected]>"
> end
> }
The problem is that #each returns the original array, i.e.
message.recipients. Your Person object is getting constructed and then
forgotten.
Try:
if messages.recipients.any? { |p| p.email =~ /a...@site\.com/ }
Person.from_address "Foo <[email protected]>"
end
--
William <[email protected]>
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk