One approach may be to build the data as a large csv. Which you could do
from ruby if you wished and you can then keep as a file. Then either
import directly to the db with sql or workbench etc. or if you want to stay
ruby, load the csv and use ar_extension import to dump the data into the
Write a Ruby script to do it, invoke it via a rake task.
On Fri, Apr 5, 2013 at 9:38 PM, haxuan lac li...@ruby-forum.com wrote:
Yes ,Thanks Gintautas
If I want create 100(1 million) pseudo data,i can this way for it?
And i hear a gem with called faker http://faker.rubyforge.org/
can i
On 6 April 2013 03:18, haxuan lac li...@ruby-forum.com wrote:
I tried create 1 pseudo by Faker but it's very slow.
I fake 1000 record about 20 minutes.
And 1 record take me 2-3 hours.
please give me some advice about this time I had done with fake pseudo
data(1000 and 1 pseudo).
On Apr 5, 2013 9:18 PM, haxuan lac li...@ruby-forum.com wrote:
I tried create 1 pseudo by Faker but it's very slow.
I fake 1000 record about 20 minutes.
And 1 record take me 2-3 hours.
please give me some advice about this time I had done with fake pseudo
data(1000 and 1 pseudo).
Thanks Greg Akins
I'm using MongoDB and in Mongodb has some table as:
user,comment,photo,relationship
And tables have ralationship(user relationship with photos..)
Could you give me some advice for this problem?Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message
You can add data via Rails models, like
User.create({ your attributes for user goes there })
Just use rails code inside seed.rb to generate whatever you like and then
run rake task which is something like `rake db:seed`
2013/4/5 haxuan lac li...@ruby-forum.com
Thanks Greg Akins
I'm using
As far as cloning development DB into test DB, check out
http://stackoverflow.com/questions/2645022/rails-populate-test-database-with-development-data
2013/4/5 Gintautas Šimkus dihita...@gmail.com
You can add data via Rails models, like
User.create({ your attributes for user goes there })
Yes ,Thanks Gintautas
If I want create 100(1 million) pseudo data,i can this way for it?
And i hear a gem with called faker http://faker.rubyforge.org/
can i using this gem for solve my problem ( create 100 pseudo data)?
Thanks very much
--
Posted via http://www.ruby-forum.com/.
--
You
Maybe, I don't know :) you just got to investigate stuff, that's part of
learning something new process :)
2013/4/5 haxuan lac li...@ruby-forum.com
Yes ,Thanks Gintautas
If I want create 100(1 million) pseudo data,i can this way for it?
And i hear a gem with called faker
Though just simple db:seed and then exporting development DB and importing
it into test DB should do the trick.
2013/4/5 Gintautas Šimkus dihita...@gmail.com
Maybe, I don't know :) you just got to investigate stuff, that's part of
learning something new process :)
2013/4/5 haxuan lac
huxuan
Faker might be overkill.. or might not. Try both approaches and let us
know which works best.
If you have ActiveRecord model defined (say User.rb)
Then just include this in the db/seed.rb
[0..100].each do |i|
User.create(:name = name#{i}, etc...)
end
A problem with this approach
Thank Gintautas,Greg Akins very much
I will do with instruction of you.
Thank you vey much again!!!
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups Ruby
on Rails: Talk group.
To unsubscribe from this group and stop
haxuan lac wrote in post #1104574:
I want to test performance of project.
So i want make 1 record of table for testing.
I don't know how to ganerate record.
Who can help me? Thanks.
Look at rails cast #179.
this has a tutorial on using seed.rub to create test data.
I tried create 1 pseudo by Faker but it's very slow.
I fake 1000 record about 20 minutes.
And 1 record take me 2-3 hours.
please give me some advice about this time I had done with fake pseudo
data(1000 and 1 pseudo).
Thanks..
--
Posted via http://www.ruby-forum.com/.
14 matches
Mail list logo