Seeding Data In Ruby On Rails

Опубликовано: 13 Март 2026
на канале: Mike Rogers
2,226
37

Let's go through the basics of Seeds in Ruby on Rails & give you a few examples of how to make awesome ones.

Mentioned Links

https://github.com/james2m/seedbank
https://github.com/faker-ruby/faker
https://thoughtbot.com/blog/factory_g...
https://github.com/evilmartians/evil-...
https://guides.rubyonrails.org/v5.0.0...

Chapters

0:00 - Seeding Data In Ruby On Rails
0:05 - What We'll Cover
0:19 - Smash the "Like" button
0:27 - What Are Seeds?
2:18 - Horror Stories On Why Seeds Are Useful (Stolen Laptop)
3:15 - Horror Stories On Why Seeds Are Useful (Preview Environment started emailing real users)
4:17 - Horror Stories On Why Seeds Are Useful (Poor Initial Developer Experience)
4:50 - Approaches To Seeding
5:06 - Approaches To Seeding (Explicitly Defined Seeds)
5:54 - Approaches To Seeding (Faker Generated Seeds)
6:43 - Approaches To Seeding (Fixtures & Factories Generated Seeds)
7:20 - Approaches To Seeding (Anonymised Production Database)
8:17 - Approaches To Seeding (Plain Old Ruby Objects)
9:05 - Testing Seeds
9:39 - What Is the Best Way?
11:36 - Questions?

Related Links

  / mikerogers0   - My Twitter
https://mikerogers.io - My Site
https://www.buymeacoffee.com/MikeRogers0 - Buy Me A Coffee

#RubyOnRails
#Tutorial
#Seeds