Guest User

Untitled

a guest
Jul 30th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. def self.new_anonymous!
  2. @@sequential ||= User.count
  3. @@sequential += 1
  4. sequential_username = "anonymous#{@@sequential}"
  5. user = User.new( :username => sequential_username,
  6. :password => '123456',
  7. :password => '123456',
  8. :email => "#{sequential_username}@scuttlehub.com",
  9. :anonymous => true)
  10. # I'm not sure why its not setting the anonymous field in the #new method
  11. user.anonymous = true
  12. user.confirm!
  13. user
  14. end
Add Comment
Please, Sign In to add comment