Created
January 14, 2020 10:07
-
-
Save whiz25/03c67642a34666b03676c2c4d7b591ac to your computer and use it in GitHub Desktop.
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
module CurrentUserConcern | |
extend ActiveSupport::Concern | |
included do | |
before_action :set_current_user | |
end | |
def set_current_user | |
if session[:user_id] | |
@current_user = User.find(session[:user_id]) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment