File tree 2 files changed +4
-5
lines changed
src/Illuminate/Database/Eloquent/Relations
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,10 @@ protected function getEagerModelKeys(array $models)
127
127
}
128
128
}
129
129
130
- // If there are no keys that were not null we will just return an array with either
131
- // null or 0 in (depending on if incrementing keys are in use) so the query wont
132
- // fail plus returns zero results, which should be what the developer expects.
130
+ // If there are no keys that were not null we will just return an array with null
131
+ // so the query wont fail plus returns zero results, which should be what the developer expects.
133
132
if (count ($ keys ) === 0 ) {
134
- return [$ this -> relationHasIncrementingId () ? 0 : null ];
133
+ return [null ];
135
134
}
136
135
137
136
sort ($ keys );
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ public function testAssociateMethodSetsForeignKeyOnModelById()
103
103
public function testDefaultEagerConstraintsWhenIncrementing ()
104
104
{
105
105
$ relation = $ this ->getRelation ();
106
- $ relation ->getQuery ()->shouldReceive ('whereIn ' )->once ()->with ('relation.id ' , m::mustBe ([0 ]));
106
+ $ relation ->getQuery ()->shouldReceive ('whereIn ' )->once ()->with ('relation.id ' , m::mustBe ([null ]));
107
107
$ models = [new MissingEloquentBelongsToModelStub , new MissingEloquentBelongsToModelStub ];
108
108
$ relation ->addEagerConstraints ($ models );
109
109
}
You can’t perform that action at this time.
0 commit comments