has_many order when using "relationships_model" => FALSE

Hi , did had time to make a right commit of that, and not 100% sure it helps
I ' m actually using relationships model in $use_rel_tbl == FALSE mode
and needed to set order and where clauses
i just noticed something was missing in this case
so the solution i propose is to add these lines in the _get_relationship method of MY_Model
instead of:
else
{


$foreign_data = $this->_CI->$foreign_model->find_all();
}
use:
else
{
$where=array();
$order=array();
if (is_array($rel_config))
{
if (! empty($rel_config['where']))
{
$where=$rel_config['where'];
}

if (! empty($rel_config['order']))
{
$order=$rel_config['order'];
}

}

$foreign_data = $this->_CI->$foreign_model->find_all($where,$order);
}

i hope that it can help someone :)

another question: why a patch-1 branch , instead of merging in 1.0 on github ?

Comments

  • edited 6:46AM
    Are you saying you submitted a pull request for this or that you are wanting to do one on the 1.0 branch?
Sign In or Register to comment.