forked from AdaGold/task-list
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathseeds.rb
More file actions
20 lines (18 loc) · 752 Bytes
/
seeds.rb
File metadata and controls
20 lines (18 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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