$characters_owned = Model_Character::find()
->related('simpleusers_api')
->where('user_id', $this->user_id)
->get();
1054! Fuel\Core\Database_Exception [ 1054 ]: Unknown column 't0.user_id' in 'where clause' [ SELECT `t0`.`id` AS `t0_c0`, `t0`.`character_id` AS `t0_c1`, `t0`.`character_name` AS `t0_c2`, `t0`.`is_public` AS `t0_c3`, `t0`.`api_id_id` AS `t0_c4`, `t1`.`id` AS `t1_c0`, `t1`.`api_id` AS `t1_c1`, `t1`.`api_key` AS `t1_c2`, `t1`.`user_id` AS `t1_c3` FROM `simpleusers_characters` AS `t0` LEFT JOIN `simpleusers_api` AS `t1` ON (`t0`.`api_id_id` = `t1`.`api_id`) WHERE `t0`.`user_id` = 25 ]
Ah, you're on RC2 aren't you? This is only supported in the latest dev branch.
public function action_index()
{
$characters_owned = Model_Character::find()
->related('simpleusers_api')
->where('simpleusers_api.user_id', $this->user_id)
->get();
// $characters_permitted = Model_Character::find();
$characters = Model_Character::find()->where('is_public', '=', 1)->order_by('character_name', 'asc')->get();
$this->template->title = 'Characters list';
$this->template->content = View::factory('characters/index')
->set('characters_owned', $characters_owned)
// ->set('characters_permitted', $characters_permitted)
->set('characters', $characters);
}
It looks like you're new here. If you want to get involved, click one of these buttons!