Thank you for the fast response, I’m still dealing with these custom scopes, i got the model one to work, but now i have a many_many scope that I can’t get the hang of…
In event controller trying to access the "not_staffed" scope…
public function actionView($id) {
$event = Event::model()->with('models','confirmed', 'proposed')->not_staffed($id)->findByPk((int) $id);
$event->address = Address::model()->findByPk($event->address_id);
$this->render('view', array(
'event' => $event,
));
}
Scope in model referencing table that combines the 2 models.
[b]Error: CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘tbl_models_events.event_id’ in ‘where clause’