Created
October 23, 2017 21:52
-
-
Save colleowino/8345b1d425fa35e4a5493ba631ab086a to your computer and use it in GitHub Desktop.
rails seeder using ffaker gem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# require 'ffaker' | |
items = ["beans", "maize", "tea"] | |
items.each do |item| | |
# each item should have an entry for each month | |
1.upto(12) do |month| | |
month_date = "2015-"+month.to_s+"-20 20:00:00" | |
Report.create( item: item, report_date: month_date, price: rand(100) ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment