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..1000000].each do |i|
User.create(:name => "name#{i}", etc...)
end

A problem with this approach is distribution of data.  If you need the
names to be distributed across an alphanumeric range (to mimic real world
data) then you might want to modify the mechanism for creating the User.


Greg Akins
http://twitter.com/akinsgre



On Fri, Apr 5, 2013 at 12:08 PM, haxuan lac <[email protected]> wrote:

> Yes ,Thanks Gintautas
> If I want create 1000000(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 1000000 pseudo data)?
> Thanks very much
>
> --
> 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 receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to