seedbank
seedbank copied to clipboard
Allow deep level seed loading
Hi, just my two cents here.
It may be useful to allow seedbank to load seed files from deep nested subdirectories. Even though it could cram up rake syntax, it would allow to store seed files following deep nested folder/namespace structure giving the user the choice to sacrifice nice rake syntax for a nice folder structure.
For example:
db/seeds/
first_level_dir/
no_problem.seeds.rb
second_level_dir/
whisful_thinking.seeds.rb
.../nth_level_dir/let_the_dev_worry.seeds.rb
I'll try to make a pull request if you find this helpful.
Happy to accept it with a test and note of the potential cost of deep nesting in the readme.
Thanks.
+1
+1
I've got a fork with this feature, it's not tested yet, but I've been using it on a project for several weeks.
You can pull it here: https://github.com/jobtitude/seedbank ( make sure you choose the nested-folders branch )
You'll be able to do something like this:
rake db:seed:development:acme:users
I'll do a pull request after making some tests.
Thanks @javifr.
@javifr just drop me a pull request when you have this and I'll try to get it into the next release. :)
Any information about how this ended up? I'm finding I need at least one more level deep for what I have to do.
It will make it in. So you're safe using the branch for the moment. I'm just super busy and travelling at the moment so not had the time to roll up a new release.
Likewise I am interested in the deeply nested seeds as we have a ton of data being loaded.
@bradgreens Check out this: https://github.com/javifr/seedbank May be it can help you, is my fork with this thing working...
@javifr I don't see anything new on your fork that is not on master or the 0.4.0 release.
Ah, I see it now on https://github.com/jobtitude/seedbank/commits/nested-folders. I'd be happy to merge if it carries some tests and doesn't break existing functionality.