I hope this does not feel like a plug:
https://github.com/metaskills/named_seeds
There is a talk I have around this gem/concept I have been using for several
years. The general idea is:
* Factories generate Valid Garbage™ which is 100% random.
* Test fixtures take advantage of said factories bu
A consistent database ... but with some random fields ;)
I guess, it's simpler to run a seed with
1.times { User.create! :first_name => Faker::Name.first_name }
than loading an hardcoded file with 1 users.
Ben
Le mercredi 17 février 2016 20:21:30 UTC+1, Derek Prior a écrit :
>
> Interes
Interesting idea. If what you're after is consistent data, why are you
randomizing anything?
On Wed, Feb 17, 2016 at 9:48 AM, Ben Colon wrote:
> Hey there,
>
> In many projects, I guess like everyone, we're using the seed file to
> generate a bunch of models with random data.
> Obviously, after
Hey there,
In many projects, I guess like everyone, we're using the seed file to
generate a bunch of models with random data.
Obviously, after running db:seed task, each developer has a "different"
database. Not cool.
If we need to sync those data, we prefix seed.rb code with something like
``