You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, the method paper_trail_enabled_for_controller always returns true, even if you have previously set PaperTrail.enabled = false.
That was making some of my controller specs to fail because PaperTrail was trying to call the user_for_paper_trail method, because paper_trail_enabled_for_controller is always true. And those controllers don't handle authentication.
I've a fix but I'd need to write some tests for it. Ok to ask for a pull-request?
The text was updated successfully, but these errors were encountered:
@maxcosworth - Any news on this? I just took a crack at an implementation but I'm not sure it covers everything. After reviewing this a little more closely I'm thinking that perhaps that the enabled_for_controller method is returning properly, but that the set_paper_trail_whodunnit method (this line) should be changed to this:
I think this makes more sense than trying to change the paper_trail_enabled_for_controller method since it is intended to be overwritten if desired. Also, I would think that in a case like yours, you might just overwrite the user_for_paper_trail method to return nil on that Controller?
@maxcosworth - I'm trying to get a move on releasing 3.0.0, so I went ahead and implemented what I thought was the proper solution for this. Please take a look at 9dd154a, I think it should address the issue you were having.
By default, the method
paper_trail_enabled_for_controller
always returns true, even if you have previously setPaperTrail.enabled = false
.That was making some of my controller specs to fail because PaperTrail was trying to call the
user_for_paper_trail
method, becausepaper_trail_enabled_for_controller
is always true. And those controllers don't handle authentication.I've a fix but I'd need to write some tests for it. Ok to ask for a pull-request?
The text was updated successfully, but these errors were encountered: