What about
class Position extends ActiveRecord{
var $has_many = array(
'monday_tasks' => array('conditions' => array('is_on_all_days = 1 OR is_on_monday = 1') ),
'tuesday_tasks' => array('conditions' => array('is_on_all_days = 1 OR is_on_tuesday = 1') ),
//............
);
}
And then you can include the association in the query where you fetch the Position?
Or loading it like
$Position->{"{$day_of_week}_tasks"}->load();
Hey, now that's clever! The only issue I see is that I'd need to do something like this
$this->Position->position_tasks = $this->Position->{"{$day_of_week}_tasks"}->load();
so that I wouldn't have to make all the downstream code dependent on what day of the week it was.
You've started me thinking in the right direction though. Thanks!
1 to 4 of 4