You can use `db/seeds.rb` as an entry point to load more seeds files: ``` # db/seeds.rb load "./seeds/admin_seeds" load "./seeds/customer_seeds" load "./seeds/more_seeds" ```
You can also set your own seed loader: https://github.com/rails/rails/blob/master/activerecord/lib/active_record/tasks/database_tasks.rb#L270-L272 On Saturday, February 4, 2017 at 8:27:00 AM UTC+1, Tom Prats wrote: > > I think it would be beneficial to loop over the array of paths in > paths["db/seeds.rb"] instead of just grabbing the first one and loading it. > Might be good to rename it"db/seeds" and prefill it with "db/seed.rb" then. > > This would especially be helpful in engines that already add migrations. > Right now this can still be achieved by hooking into the rake task but it's > not as great (either runs after the app's seeds that may be dependent on it > or it runs before the whole task, missing the abort_if_pending_migrations > check which loads the environment and config). > > If this is something you'd be interested in, I can create a pull request! > > > https://github.com/rails/rails/blob/8898a0ae2a0d5c8826fe08bbf4ccd10745802f9e/railties/lib/rails/engine.rb#L548 > > https://github.com/rails/rails/blob/fdc219e0f857c372748296eae9cc5828ffb2c2c3/activerecord/lib/active_record/railties/databases.rake > > Thanks, > Tom > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.