Skip to content

Commit

Permalink
Add seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
kariabancroft committed Nov 9, 2015
1 parent f65ec6c commit bea22c4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions seeds.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def random_time
Time.at(rand * Time.now.to_i)
end

tasks = [
{ name: "The First Task", description: "", completed_at: random_time },
{ name: "Go to Brunch", description: "" },
{ name: "Go to Lunch", description: "", completed_at: random_time },
{ name: "Go to Second Lunch", description: "" },
{ name: "Play Video Games", description: "", completed_at: random_time },
{ name: "High Five Somebody You Don't Know", description: "", completed_at: random_time },
{ name: "Plant Flowers", description: "", completed_at: random_time },
{ name: "Call Mom", description: "" },
{ name: "She worries, you know.", description: "" },
{ name: "Nap.", description: "", completed_at: random_time }
]

tasks.each do |task|
Task.create task
end

0 comments on commit bea22c4

Please sign in to comment.