Skip to content

Commit 7cab954

Browse files
committed
Get key name from adapter model, not query model
1 parent 2ca836d commit 7cab954

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.0] - 2022-06-21
9+
### Fixed
10+
- Fix `EloquentAdapter::filterByIds()` getting key name from query model instead of adapter model
11+
812
## [0.2.0-beta.6] - 2022-04-22
913
### Changed
1014
- Add support for `doctrine/inflector:^2.0`
@@ -74,6 +78,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7478
### Fixed
7579
- Fix pagination next link appearing when it shouldn't
7680

81+
[0.2.0]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0...v0.2.0-beta.6
82+
[0.2.0-beta.6]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.6...v0.2.0-beta.5
7783
[0.2.0-beta.5]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.5...v0.2.0-beta.4
7884
[0.2.0-beta.4]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.4...v0.2.0-beta.3
7985
[0.2.0-beta.3]: https://github.com/tobyzerner/json-api-server/compare/v0.2.0-beta.3...v0.2.0-beta.2

src/Adapter/EloquentAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function query(): Builder
4848

4949
public function filterByIds($query, array $ids): void
5050
{
51-
$query->whereIn($query->getModel()->getQualifiedKeyName(), $ids);
51+
$query->whereIn($this->model->getQualifiedKeyName(), $ids);
5252
}
5353

5454
public function filterByAttribute($query, Attribute $attribute, $value, string $operator = '='): void

0 commit comments

Comments
 (0)