This commit is contained in:
Toby Zerner 2015-06-19 17:19:13 +09:30
parent f07e2d9520
commit 525af6f168

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;