Can I somehow execute my db/seeds.rb file from my rails app?

后端 未结 2 1038
别那么骄傲
别那么骄傲 2020-12-08 03:56

I am building a demo, and I want to make it very easy for a non-technical person to set up and run the demo. I have built a seeds.rb file with lots of demo data in it. I w

相关标签:
2条回答
  • 2020-12-08 04:42

    I prefer the classic method:

    bundle exec rails db:seed
    

    But I guess, that you can also call Rails.application.load_seed as mentioned.

    0 讨论(0)
  • 2020-12-08 04:56

    You can call Rails.application.load_seed. That's all rake db:seed does.

    0 讨论(0)
提交回复
热议问题