Also audit when model is already bootstrapped before auditing was enabled#1040
Also audit when model is already bootstrapped before auditing was enabled#1040gisostallenberg wants to merge 1 commit intoowen-it:masterfrom
Conversation
| */ | ||
| public static function bootAuditable() | ||
| { | ||
| if (App::getFacadeRoot() && static::isAuditingEnabled()) { |
There was a problem hiding this comment.
@erikn69 I can't remember why the App::getFacadeRoot() check is required but I definitely remember needing it at some point, does that ring any bells for you?
There was a problem hiding this comment.
There was a problem hiding this comment.
Ok, but that will in some cases make audits not happen at all (because when the app is not spun up, but the model gets booted, it will never observe)
The tests succeed, even OutsideOfAppContextTest
There was a problem hiding this comment.
I think something is being reversed; I believe it was perhaps for performance reasons, to avoid always registering observers, I don't remember.
It seems it's always been like this: #134
| return; | ||
| } | ||
| $modelClass = $model::class; | ||
| if (method_exists($modelClass, 'isAuditingEnabled') && ! $modelClass::isAuditingEnabled()) { |
There was a problem hiding this comment.
it seems like one check has been replaced by two, is this one definitely needed? should there be a separate test to pick it up?
No description provided.