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

Fix find cannot use scopes #893

Merged

Conversation

circulon
Copy link
Contributor

@circulon circulon commented Sep 11, 2024

This PR fixes the issue when using a mixin scope like SofDelete with .find() will not find the record.
This is due to only the global scope being applied regardless.

This impacts records that have defaults that the gloal scop excludes
example:

  • create a record that sets active=False by default
  • the global scope is active=True
  • Record.find(some_id) # works as expected with glpba; scope and finds no record
  • Record.is_inactive().find(some_id) # should wprk by setting scope where active=False to allow finding the record but is not applied

@circulon
Copy link
Contributor Author

@josephmancuso @eaguad1337
I think this is completed now
cheers

@josephmancuso josephmancuso merged commit 8d5da73 into MasoniteFramework:2.0 Oct 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants