This commit is contained in:
Toby Zerner 2015-06-19 17:19:13 +09:30
parent 80a11ccc86
commit 5d5bbb9832

View File

@ -58,7 +58,7 @@ abstract class BaseSerializer extends SerializerAbstract
$data = $model->getRelation($relation);
} elseif ($many) {
$relationIds = $relation.'_ids';
$data = $model->$relationIds ?: $model->$relation()->get(['id'])->fetch('id')->all();
$data = $model->$relationIds ?: $model->$relation()->lists('id');
} else {
$relationId = $relation.'_id';
$data = $model->$relationId;