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

Issue while using with_("users") #565

Closed
yubarajshrestha opened this issue Jan 4, 2022 · 1 comment
Closed

Issue while using with_("users") #565

yubarajshrestha opened this issue Jan 4, 2022 · 1 comment

Comments

@yubarajshrestha
Copy link
Contributor

Describe the bug
If you use with_("users") then this will give issue related to deleted_at field.

To Reproduce

UserModel

class User(Model, SoftDeletesMixin, Authenticates):
    """User Model."""

    __fillable__ = ["name", "email", "password", "verified_at"]
    __hidden__ = ["password"]
    __auth__ = "email"

    @belongs_to_many('user_id', 'role_id', 'id', 'id')
    def roles(self):
        from app.models.Role import Role
        return Role

Role Model

class Role(Model):
    """Role Model."""

    __fillable__ = [ "name", "slug", "status"]

    @belongs_to_many('role_id', 'user_id', 'id', 'id')
    def users(self):
        from app.models.User import User
        return User

Implementation

roles = Role.with_("users").get()
        return roles

Issue
Screen Shot 2022-01-04 at 10 44 52

Note: I have not used SoftDeletesMixin in Role, because I don't need that in Role Model.

@josephmancuso josephmancuso transferred this issue from MasoniteFramework/masonite Jan 5, 2022
@josephmancuso
Copy link
Member

Fixed in #566

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

No branches or pull requests

2 participants