Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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]
- withdrawals = [15,16,17,21,22]
- (1..25).each do |i|
- options = {
- email: "user_#{i}@mtw.com",
- password: 'Pass1234',
- login: "user_#{i}",
- first_name: 'mr',
- last_name: "user_#{i}",
- birthdate: 18.years.ago,
- address_number: '1',
- city: 'Lon',
- region: 'LDN',
- postcode: 'NW5',
- phone: '1234567890',
- country: 'United Kingdom',
- country_code: 'GB',
- timezone: 'UTC',
- currency_id: 1,
- security_question1_id: 1,
- security_question1_answer: 'q',
- security_question2_id: 2,
- security_question2_answer: 'w',
- is_repeat_user: false }
- u = User.new(options)
- puts u.save ? options[:login] : u.errors.first
- if currency[i]>1
- u.upgrade! remote_ip: nil
- u.currency_id = currency[i]
- u.save
- end
- if withdrawals.include?(i)
- u.age_verified_at = Time.now
- u.save
- d = u.deposits.build currency_id: u.currency_id, amount: 100, trade_currency_id: u.currency_id, trade_amount: 100
- d.save
- d.approve!
- d.created_at = 2.days.ago
- d.save
- w = u.withdrawals.build currency_id: u.currency_id, amount: 100, cash_currency_id: u.currency_id, cash_amount: 100
- w.save
- w.approve!
- w.save
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement