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
d
Write a Ruby script to do it, invoke it via a rake task.
On Fri, Apr 5, 2013 at 9:38 PM, haxuan lac 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 using this gem for
On Apr 5, 2013 9:18 PM, "haxuan lac" 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
On 6 April 2013 03:18, haxuan lac 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).
I think it has b
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/.
--
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.
http://railscasts.c
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 receiv
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
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
> Maybe, I don't know :) you just got to investigate stuff, that's part of
> learning something new process :)
>
>
> 2013/4/5 haxuan lac
>
>> Yes ,Thanks Gi
Maybe, I don't know :) you just got to investigate stuff, that's part of
learning something new process :)
2013/4/5 haxuan lac
> 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/
> ca
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/.
--
Yo
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
> You can add data via Rails models, like
>
> User.create({
> Just use rails code inside seed.rb to generate whatev
You can add data via Rails models, like
User.create({
> 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
>
> --
>
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
14 matches
Mail list logo