Skip to content
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

Approval fails for models with a morphMap #38

Closed
AndrewMast opened this issue Oct 2, 2023 · 2 comments · Fixed by #39
Closed

Approval fails for models with a morphMap #38

AndrewMast opened this issue Oct 2, 2023 · 2 comments · Fixed by #39
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@AndrewMast
Copy link

When a model has a morphMap alias (see docs), approving the Approval results in the error Error: Class "model_name" not found.

When creating the class, Relation::getMorphedModel($approvalable_type) should be called instead of directly instancing the database table value.

@cjmellor cjmellor added bug Something isn't working good first issue Good for newcomers labels Oct 2, 2023
@cjmellor
Copy link
Owner

cjmellor commented Oct 2, 2023

Thanks for bringing this to my attention.

I'll take a look at it later but also open to a PR to help out.

@cjmellor cjmellor self-assigned this Oct 2, 2023
@cjmellor cjmellor linked a pull request Oct 2, 2023 that will close this issue
@cjmellor
Copy link
Owner

cjmellor commented Oct 2, 2023

Thanks again for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants