I have a model called Contact.
I have added the following method:
def all_completed_events
# for a given Contact, return all contact_events records that exist and where sugarcrm = false
return (self.contact_letters + self.contact_postalcards + self.contact_emails + self.contact_voicemails + self.contact_calls)
end
What is missing from these is that I only want self.contact_letters.find(:conditions => "sugarcrm = false") to be the ones selected (sugarcrm is boolean). (obviously this is applied across the other models, contact_letters, contact_emails, etcetera)
How do I do that?