Browse Source

ActiveRelationTrait::getModelKey() updated to work with non scalar keys.

tags/2.0.0-beta
Klimov Paul 11 years ago
parent
commit
cddb878360
  1. 3
      framework/yii/db/ActiveRelationTrait.php

3
framework/yii/db/ActiveRelationTrait.php

@ -203,7 +203,8 @@ trait ActiveRelationTrait
return serialize($key); return serialize($key);
} else { } else {
$attribute = reset($attributes); $attribute = reset($attributes);
return $model[$attribute]; $key = $model[$attribute];
return is_scalar($key) ? $key : serialize($key);
} }
} }

Loading…
Cancel
Save