-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.x] Adds the
firstOrCreate
and createOrFirst
methods to the `H…
…asManyThrough` relation (#48541) * Test firstOrCreate on HasManyThrough relation * Add the firstOrCreate method in the HasManyThrough relation to avoid select * issue * Invert the if statement on the firstOrCreate method * Adds tests for the firstOrCreate when model doesn't exist * Test createOrFirst on HasManyThrough relations with existing models * Fix the createOrFirst also happening the regression test from the updateOrCreate * Wraps the create part of the createOrFirst in a savepoint if needed * Fix comment * Adds the not is_null in the guard if statement
- Loading branch information
Showing
2 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters