look at this Factory.define :user do |f| f.sequence(:username) { |n| "user#{n}" } f.sequence(:email) { |n| "test#...@example.com <n...@example.com>" } f.association :company f.password "password" f.password_confirmation { |u| u.password } f.sequence(:name) { |n| "test#{n}" } f.sequence(:last_name) { |n| "test_l#{n}" } f.sequence(:cedula) { |n| "0011357433#{n}" } end
with this factory_girl will create all the user you want as you can see it accepts a sequence and will create ad many user as needed On Thu, Sep 16, 2010 at 10:20 AM, Joshua Muheim <li...@ruby-forum.com>wrote: > radhames brito wrote: > > fixtures are hard to maintain and impractical comprared to factories, > > factories are pluging/gems that create object dinamicly as needed so > > you > > can do thing like this > > > > i have 100 users > > > > with that the factory will create on the fly 100 users and you can later > > change that 100 to 1000 . > > Sounds very, very interesting. Thanks a lot for this hint. > -- > 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 post to this group, send email to rubyonrails-t...@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.