Created
February 10, 2015 10:48
-
-
Save ralphking/b86edbaefad1794e4385 to your computer and use it in GitHub Desktop.
Persisting guests users in devise.
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
# use this if you are using cancan/cancancan gem for authoriazation. This passes your new current_or_guest_user method to cancan rather | |
# than the usual devise current_user method | |
def current_ability | |
@current_ability ||= Ability.new(current_or_guest_user) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment