Skip to content

Commit

Permalink
Corrected ind-type tests; Added more tests for unknown relationships
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Aug 2, 2018
1 parent 7090340 commit fb9b89a
Show file tree
Hide file tree
Showing 5 changed files with 432 additions and 127 deletions.
11 changes: 9 additions & 2 deletions api/controllers/IndividualTypes/GetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Niden\Api\Controllers\BaseController;
use Niden\Constants\Relationships;
use Niden\Models\IndividualTypes;
use Niden\Transformers\BaseTransformer;
use Niden\Transformers\IndividualTypesTransformer;

/**
* Class GetController
Expand All @@ -18,9 +18,16 @@ class GetController extends BaseController
{
/** @var string */
protected $model = IndividualTypes::class;

/** @var array */
protected $relationships = [
Relationships::INDIVIDUALS,
];

/** @var string */
protected $resource = Relationships::INDIVIDUAL_TYPES;

/** @var string */
protected $transformer = BaseTransformer::class;
protected $transformer = IndividualTypesTransformer::class;
}

2 changes: 1 addition & 1 deletion library/Models/IndividualTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class IndividualTypes extends AbstractModel
*/
public function initialize()
{
$this->belongsTo(
$this->hasMany(
'id',
Individuals::class,
'typeId',
Expand Down
Loading

0 comments on commit fb9b89a

Please sign in to comment.