It looks like using Rails test fixtures (reborn) to create seed data. Which is an OK win I guess, and having it separated out by environment (implicitly mentioned in the article) is nice.. but I don't see how much of a win this is over instantiating fixtures or FactoryGirl.create in your seeds.rb file.<p>Yes, there are tons of problems with using db/seeds.rb for anything serious. I'm not sure that Sprig will handle my issues much better than I currently do myself.<p>For the record, my desired behaviors for a seed data solution are:<p>1. environmental separation (which Sprig has). Developers have different needs for seed data as QA does, as does the staging server, as does production. Developers want an easy default dev@myco.com user with a simple password, but you don't want that in production.<p>2. If I rerun my seed solution (perhaps because I added some more seed data) it shouldn't duplicate records (or throw errors because it's trying to create the second user with the same email address)<p>3. Handle bootstrap data I need in my app (example: I want a list of US states, and every environment should get this. To reiterate my second point, I should be able to add to this bootstrap data without getting two copies of "California" in my US state list).<p>It's sad that no real solution exists to handle all three of these needs. Some projects I've been on have gotten this close, but that was years ago and things have changed.<p>(If Sprig does have these things, then that's the selling point, not seed data as fixtures which the article emphasized)<p>I'm also not sure about using fixture like things in Sprig. I give it 6 months before most users remember why many people in the Rails community moved to a Factory pattern for (test) data construction long ago.<p>However, I am happy that a relatively well known Rails consultancy is released 1.0 of a seed gem. Hopefully the name recognition / noise will lead developers to the gem and I'll be a better solution with many more eyes.
I completely expected the OP to have had a typo in the headline and for it to actually be about "Spring", which is an amazing an essential gem (and part of 4.1beta)...but this is pretty cool too :).<p>I'm biased because the OP shows off a custom-parser for Google Spreadsheets, which is neat to me because Google Spreadsheets is my goto-interface for new prototyped apps...a much better, live-collaborative admin than anything I could easily build myself or with Rails tools.<p>But I wonder if this gem is more work than its worth? I mean, seeds don't seem like the best place to persist intricate production-ready data in the repo. And if you continue to use Google Spreadsheets, or whatever, as your main admin input interface, then it seems worth it to build a more elaborate abstraction to handle that usecase.<p>Also, I wonder if some of the self-referencing could be done via YAML's standard syntax? That would mean no JSON as a format, but YAML seems like it was built for this kind of lightweight relational data storage?
This feels like just re-inventing the wheel again. The seedbank gem <a href="https://github.com/james2m/seedbank" rel="nofollow">https://github.com/james2m/seedbank</a> has been around for a couple of years and does a great job for managing seeds on a natural, more granular level, if that is what you need.