Today I Learned

hashrocket A Hashrocket project

Run `db/seeds.rb` from within Ruby

In a rails project, you can run the seeds programmatically from within Ruby. In my case, I used this to seed some configuration data before the test suite ran.

 Rails.application.load_seed

https://api.rubyonrails.org/classes/ActiveRecord/Tasks/DatabaseTasks.html#method-i-load_seed

See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.