You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
You cannot declare scopes with the same name in different models. If you do that, the last declared one overwrites the previous ones.
To Reproduce
classCat(Model):
# suppose Cats table has only the 'cat_color' column@scopedeffilter_color(self, query, op='=', value=''):
returnquery.where('cat_color', op, value)
classDog(Model):
# suppose Dogs table has only the 'dog_color' column@scopedeffilter_color(self, query, op='=', value=''):
returnquery.where('dog_color', op, value)
cat=Cat.filter_color("=", "white").first() # the wrong scope is called (from the Dog class)
Expected behavior
Scopes should be retrieved from the correct class in which they are declared.
What database are you using?
Type: MySQL
Version: 5.7
Masonite ORM: v2.18.4
The text was updated successfully, but these errors were encountered:
Describe the bug
You cannot declare scopes with the same name in different models. If you do that, the last declared one overwrites the previous ones.
To Reproduce
Expected behavior
Scopes should be retrieved from the correct class in which they are declared.
What database are you using?
The text was updated successfully, but these errors were encountered: