Created
April 20, 2010 19:47
-
-
Save zeroeth/372962 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
def login_as(user) | |
id = nil | |
if user | |
if user.kind_of? ActiveRecord::Base | |
id = user.id | |
else | |
id = users(user).id | |
end | |
end | |
@request.session[:user_id] = id | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment