Advertisement
Guest User

Untitled

a guest
May 13th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. currency = [-1,1,1,2,2,1,1,1,2,2,1,2,1,2,1,3,3,3,1,3,4,2,2,3,1,3]
  2. withdrawals = [15,16,17,21,22]
  3. (1..25).each do |i|
  4. options = {
  5. email: "user_#{i}@mtw.com",
  6. password: 'Pass1234',
  7. login: "user_#{i}",
  8. first_name: 'mr',
  9. last_name: "user_#{i}",
  10. birthdate: 18.years.ago,
  11. address_number: '1',
  12. city: 'Lon',
  13. region: 'LDN',
  14. postcode: 'NW5',
  15. phone: '1234567890',
  16. country: 'United Kingdom',
  17. country_code: 'GB',
  18. timezone: 'UTC',
  19. currency_id: 1,
  20. security_question1_id: 1,
  21. security_question1_answer: 'q',
  22. security_question2_id: 2,
  23. security_question2_answer: 'w',
  24. is_repeat_user: false }
  25. u = User.new(options)
  26. puts u.save ? options[:login] : u.errors.first
  27. if currency[i]>1
  28. u.upgrade! remote_ip: nil
  29. u.currency_id = currency[i]
  30. u.save
  31. end
  32. if withdrawals.include?(i)
  33. u.age_verified_at = Time.now
  34. u.save
  35. d = u.deposits.build currency_id: u.currency_id, amount: 100, trade_currency_id: u.currency_id, trade_amount: 100
  36. d.save
  37. d.approve!
  38. d.created_at = 2.days.ago
  39. d.save
  40. w = u.withdrawals.build currency_id: u.currency_id, amount: 100, cash_currency_id: u.currency_id, cash_amount: 100
  41. w.save
  42. w.approve!
  43. w.save
  44. end
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement