Expected behavior
The class attribute __connection__ should not be changed.
I think the correct behaviour should be to passthrough the on method towards the QueryBuilder instance, so removing the class method or using another name for it (e.g.: global_on).
Describe the bug In the
Model
class we have theon
method defined both in the__passthrough__
list and a class method: https://github.com/MasoniteFramework/orm/blob/0ed95841f5cc52f8b8a7d443be1119a0e6e13a6d/src/masoniteorm/models/Model.py#L183 https://github.com/MasoniteFramework/orm/blob/0ed95841f5cc52f8b8a7d443be1119a0e6e13a6d/src/masoniteorm/models/Model.py#L1008-L1011Given this fact, it seems that the classmethod is always called, see the following example:
Expected behavior The class attribute
__connection__
should not be changed. I think the correct behaviour should be to passthrough theon
method towards theQueryBuilder
instance, so removing the class method or using another name for it (e.g.:global_on
).