Sijo,
not sure, but looking at your code it seems you may want to do something
like the following
def self.get_email_ids_of_contacts(contact_id)
contact = Contact.find_by_id(contact_id)
contact.contact_email_addresses.find(:all, :conditions => []).map do
|mail|
[contact.name, mail.email]
end
end
Sijo Kg wrote:
>
> def self.get_email_ids_of_contacts(contact_id)
> return Contact.find_by_id(contact_id).name,
> Contact.find_by_id(contact_id).contact_email_addresses.find(:all,
> :conditions => ['contact_email_address_type_id=?',2]).collect { |mail|
> mail.email}
> end
--
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---