Skip to content

Commit

Permalink
dev: fixed dynamic models to refresh when sid changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mennodekker committed May 8, 2012
1 parent e3d0e66 commit aee8bd7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions application/models/Tokens_dynamic.php
Expand Up @@ -41,10 +41,17 @@ public static function sid($sid)
*/
public static function model($sid = null)
{
if (!is_null($sid))
self::sid($sid);
$refresh = false;
if (!is_null($sid)) {
self::sid($sid);
$refresh = true;
}

$model = parent::model(__CLASS__);

return parent::model(__CLASS__);
//We need to refresh if we changed sid
if ($refresh === true) $model->refreshMetaData();
return $model;
}

/**
Expand Down

0 comments on commit aee8bd7

Please sign in to comment.