seedbank icon indicating copy to clipboard operation
seedbank copied to clipboard

Allow deep level seed loading

Open guapolo opened this issue 11 years ago • 12 comments

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.

guapolo avatar May 10 '14 17:05 guapolo

Happy to accept it with a test and note of the potential cost of deep nesting in the readme.

Thanks.

james2m avatar May 10 '14 23:05 james2m

+1

javifr avatar Jul 31 '14 11:07 javifr

+1

pmackay avatar Aug 12 '14 12:08 pmackay

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.

javifr avatar Nov 28 '14 22:11 javifr

Thanks @javifr.

james2m avatar Nov 29 '14 01:11 james2m

@javifr just drop me a pull request when you have this and I'll try to get it into the next release. :)

james2m avatar Dec 02 '14 04:12 james2m

Any information about how this ended up? I'm finding I need at least one more level deep for what I have to do.

JD-Kaplan avatar May 04 '15 12:05 JD-Kaplan

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.

james2m avatar May 04 '15 14:05 james2m

Likewise I am interested in the deeply nested seeds as we have a ton of data being loaded.

bradgreens avatar Aug 09 '16 20:08 bradgreens

@bradgreens Check out this: https://github.com/javifr/seedbank May be it can help you, is my fork with this thing working...

javifr avatar Aug 09 '16 21:08 javifr

@javifr I don't see anything new on your fork that is not on master or the 0.4.0 release.

james2m avatar Aug 13 '16 05:08 james2m

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.

james2m avatar Aug 13 '16 05:08 james2m