Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Created April 20, 2010 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroeth/372962 to your computer and use it in GitHub Desktop.
Save zeroeth/372962 to your computer and use it in GitHub Desktop.
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