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

shouldApplyBannedAtScope() causes unban() to be unusable. #28

Closed
rickmacgillis opened this issue Sep 20, 2018 · 3 comments
Closed

shouldApplyBannedAtScope() causes unban() to be unusable. #28

rickmacgillis opened this issue Sep 20, 2018 · 3 comments

Comments

@rickmacgillis
Copy link
Contributor

I tried to apply the shouldApplyBannedAtScope() method on the User model, and when I called $user->unban() in my unit test, it started complaining about the bans property being called on NULL in BanObserver. That's because the morphTo wasn't able to locate the now-deleted model through the bannable property.

@antonkomarev
Copy link
Member

@rickmacgillis I'll check it ASAP, could you provide a code sample how to achieve this bug?

@rickmacgillis
Copy link
Contributor Author

Steps to reproduce:

  1. Add the shouldApplyBannedAtScope() method to the bannable such that it returns true always.
  2. Create a user to ban.
  3. Ban the user.
  4. Try to unban the user.

@antonkomarev
Copy link
Member

antonkomarev commented Sep 21, 2018

@rickmacgillis confirmed and fixed in PR #30. Will be included in next minor release.

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