How do I best run a search on Date when it is not a :has_many association?
- by Angela
I have a number of activities that have a calculated scheduled date. The activities, for example, Email, have a email.days method which is the days from a Contact.start_date on which it should be sent.
This means contact.start_date + email.days yields a date on which email is sent to contact.
I would like to use link_to around the date, so I can see all the emails and associated contacts that are to be scheduled on that date.
However, this "date" is not an attribute or an associate, so I'm not linking to a model's view. It's calculated.
So:
1) What should the actual "format" of the date that gets passed in the URl be? What is the method to do the consistent conversion?
2) How do I (find) all instances, because this "date" is not an actual attribute, is it a calculated value which changes depending on the two associated models of Contact and Email.
Thanks.