populated seeds

SEED_MULTIPLIER works up to 20 at least (takes 3-4 min), creating 2500 users
No, it wouldn't. Just for legibility.

On Fri, Oct 3, 2014 at 6:49 PM, Andur Carr <notifications@github.com> wrote:

> In db/seeds.rb:
>
> > +  id += 1
> > +end
> > +
> > +#for iterating
> > +users = User.all.to_a
> > +
> > +#find all of each user's addresses and set billing/shipping defaults
> > +users.each do |user|
> > +  u_addresses = Address.where(:user_id => user.id)
> > +
> > +  if u_addresses.any?
> > +    user.billing_id = u_addresses.first.id
> > +    user.shipping_id = u_addresses.last.id
> > +    user.save
> > +  else
> > +    #skip it to avoid errors
>
> Would it still throw errors if it had no 'else' statement?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/vikingeducation/viking_store/pull/1/files#r18426901>.
>



-- 

*Michael Alexander*

(310) 429-8822

alexandermw@gmail.com