-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Transfer Model #858
Conversation
Update Transfer model to support dynamic loading of overwritten Wallet or Transaction model classes. Defaults to current Wallet and Transaction model from inside the package if no overwritten models specified. Signed-off-by: George Klincarski <[email protected]>
Transfer model has `from` and `to` relationships that actually morphed in the database. This change reflects that on the model too. Signed-off-by: George Klincarski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the configuration, I don't mind, you're right. But there is no need to return morphTo. To_type & from_type will be removed in version 11.x.
@gkmk Also, I ask you to write a unit test for this code, if it’s not difficult for you. |
@gkmk I looked at your code carefully and realized that this code is not necessary. $this->app->bind(Transaction::class, $configure['transaction']['model'] ?? null);
$this->app->bind(Transfer::class, $configure['transfer']['model'] ?? null);
$this->app->bind(Wallet::class, $configure['wallet']['model'] ?? null); See: #859 |
@rez1dent3 i see. I think we should check the migrations then because i switched to morph to relationship just because of the database structure. |
@gkmk okay. revert the changes with morphTo and I will merge. |
Signed-off-by: George Klincarski <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #858 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 552 552
===========================================
Files 83 83
Lines 1949 1949
===========================================
Hits 1949 1949 ☔ View full report in Codecov by Sentry. |
Update Transfer model to support dynamic loading of overwritten Wallet or Transaction model classes.
Defaults to current Wallet and Transaction model from inside the package if no overwritten models specified.