daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Apr 27th, 2018 212 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   def login_as_trial_user
  2.     name = "anonymous_#{Time.now.to_i * rand}"
  3.     if User.find_by_username(name)
  4.       UserSession.create(User.find_by_username(name),true)
  5.     else
  6.       guest_role = User.create(:username => name, :password => name, :password_confirmation => name, :role => "guest", :email => "change@this.com")
  7.       UserSession.create(guest_role, true)
  8.     end
  9.     @current_user_session = UserSession.find
  10.     guest_role
  11.   end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top