2015-09-11 17:26:23 +02:00
|
|
|
unless Rails.env.production?
|
|
|
|
require 'factory_girl'
|
|
|
|
require 'faker'
|
|
|
|
task :sow => :environment do
|
|
|
|
users = FactoryGirl.create_list(:user, 20)
|
|
|
|
100.times do
|
|
|
|
sample_users = users.sample(2)
|
2015-09-14 16:50:47 +02:00
|
|
|
FactoryGirl.create :transaction, debtor: sample_users[0], creditor: sample_users[1]
|
|
|
|
end
|
|
|
|
clients = FactoryGirl.create_list(:client, 5)
|
|
|
|
100.times do
|
|
|
|
debtor, creditor = users.sample(2)
|
|
|
|
FactoryGirl.create :client_transaction, issuer: clients.sample, debtor: debtor, creditor: creditor
|
2015-09-11 17:26:23 +02:00
|
|
|
end
|
2015-09-08 16:45:46 +02:00
|
|
|
end
|
|
|
|
end
|