From: Sijo Kg Date: 2008-09-09T18:14:16+09:00 Subject: collect Hi I have to collect mail addresses like below Contact.find_by_id(problem.reported_by_id).contact_email_addresses.find(:all, :conditions => ['contact_email_address_type_id=?',2]) Executing above what i am getting is two objects of class ContactEmailAddress and in that an email field is there. For example abc@gmail.com and abc@yahoo.com So how can I collect this to an array ? I tried like EmailArray << Contact.find_by_id(problem.reported_by_id).contact_email_addresses.find(:all, :conditions => ['contact_email_address_type_id=?',2]).collect { |mail| mail.email} But is not working.Could you please tell me how I can achieve this?The above is clearly problem.reported_by_id (ie MailIds of ReportedBy person) My code continues like Contact.find_by_id(problem.analyst_id).contact_email_addresses.find(:all, :conditions => ['contact_email_address_type_id=?',2]) Please note analyst_id above..I have to do the same thing to this also ie to collect mails of Analyst also like above to the same EmailArray..Like that Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/.