populated seeds

SEED_MULTIPLIER works up to 20 at least (takes 3-4 min), creating 2500 users
Yes, yes it does. I sorta wanted this one to show a MASSIVE home base of
operations. Obviously easy to tweak.

On Fri, Oct 3, 2014 at 6:47 PM, Andur Carr <notifications@github.com> wrote:

> In db/seeds.rb:
>
> > +
> > +#create 50/25/12/6/3/2/1 split for cities, states
> > +
> > +percent = 50
> > +id = 1
> > +
> > +while percent > 1 do
> > +  (percent * SEED_MULTIPLIER).times do
> > +    a = Address.find_by_city(0)
> > +    a.city = id
> > +    a.state = id
> > +    a.save
> > +  end
> > +
> > +  #iterate both the percentage and the city/state id
> > +  percent /= 2
>
> I find this use of percentages as multipliers very interesting. Do I
> understand correctly that it gives 50% of addresses to the same city and
> state?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/vikingeducation/viking_store/pull/1/files#r18426889>.
>



-- 

*Michael Alexander*

(310) 429-8822

alexandermw@gmail.com