MikeRogers0/MikeRogersIO

View on GitHub
src/_videos/2020-09-22-seeding-data-in-ruby-on-rails-rubyonrails.md

Summary

Maintainability
Test Coverage
---
layout: video
title: 'Seeding Data In Ruby On Rails #RubyOnRails'
youtube_id: _HSudwhdAR8
published_at: '2020-09-22T07:39:09Z'
---
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_girl-for-seed-data
https://github.com/evilmartians/evil-seed
https://guides.rubyonrails.org/v5.0.0/active_record_migrations.html#migrations-and-seed-data

# 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

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

#RubyOnRails
#Tutorial
#Seeds