S
Sijo Kg
Hi
I have to collect mail addresses like below
Contact.find_by_id(problem.reported_by_id).contact_email_addresses.findall,
: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
(e-mail address removed) and (e-mail address removed)
So how can I collect this to an array ? I tried like
EmailArray <<
Contact.find_by_id(problem.reported_by_id).contact_email_addresses.findall,
: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.findall,
: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
I have to collect mail addresses like below
Contact.find_by_id(problem.reported_by_id).contact_email_addresses.findall,
: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
(e-mail address removed) and (e-mail address removed)
So how can I collect this to an array ? I tried like
EmailArray <<
Contact.find_by_id(problem.reported_by_id).contact_email_addresses.findall,
: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.findall,
: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