cybercog / laravel-eloquent-flag

Laravel Eloquent boolean & timestamp flagged attributes behavior.
https://komarev.com/sources/laravel-eloquent-flag
MIT License
133 stars 21 forks source link

undoActivate from HasActiveFlag not working #61

Closed rayronvictor closed 4 years ago

rayronvictor commented 4 years ago

$this->save() shouldn't be after $this->setAttribute('is_active', false);?

https://github.com/cybercog/laravel-eloquent-flag/blob/504bbd7e16d33c0eed12441cec51f3e92d8a50a1/src/Traits/Classic/HasActiveFlagHelpers.php#L41-L47

antonkomarev commented 4 years ago

v5.1.1 has been released with your fix.

Now I see that tests are written incorrectly. We are not taking fresh records before assertions.