Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby ActiveRecord Basics AR Extensions Sample Data / Indexes

Rustem Bedretdinov
Rustem Bedretdinov
3,439 Points

Why are we developing rake task to feed out app with data instead of using fixture or FactoryGirl?

Is it done just for this specific example?

2 Answers

Or just throw your Faker loop into /db/seeds.rb and run rake db:seed. I'm pretty sure that's what it's for. It's right next to your migrations and schema. It runs automatically with rake db:setup if somebody else clones your project to start working on the project.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

What is wrong with doing it this way? There are lots of ways to do different tasks in Rails, this was Hampton's choice.