-
Notifications
You must be signed in to change notification settings - Fork 901
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring default :user_for_paper_trail method so that 'current_use…
…r' only gets invoked if it is defined. Close #228
- Loading branch information
Ben Atkins
committed
May 22, 2013
1 parent
e6ba772
commit 9da4930
Showing
2 changed files
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9da4930
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit breaks my konacha test suite with devise
I know it's not really your responsibility to make sure it plays well with other gems, but this was working fine up until this commit.
The nil object it's trying to call authenticate on is
request.env['warden']
9da4930
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... Ironically this commit was made in an effort to be more compatible with Warden (see #228). Perhaps the implementation could be changed to this:
Seems a little overkill haha. Alternatively you can overwrite the
user_for_paper_trail
method in your ApplicationController and put whatever you want / need in there.9da4930
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gone with the following, but if I hadn't been following along with the commits, this may have really thrown me for a while
9da4930
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is this just a matter of you not disabling PaperTrail in the test suite when you intended to or do you have some sort of a suggestion for a modification to the code?
9da4930
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the answer is in this situation, previously it was swallowing an error that it probably shouldn't have, so I guess this is the correct behaviour. I'm just trying to think if there's a better way to fail. I guess we just hope that this makes it into Google
9da4930
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍