tab/lib/tasks/devseed.rake

12 lines
286 B
Ruby
Raw Normal View History

require 'factory_girl'
2015-09-08 21:07:00 +02:00
require 'faker'
task :sow => :environment do
users = FactoryGirl.create_list(:user, 20)
100.times do
2015-09-08 21:07:00 +02:00
sample_users = users.sample(2)
FactoryGirl.create :transaction, debtor: sample_users[0], creditor: sample_users[1], amount: 1 + rand(100)
end
end