Skip to content
Newer
Older
100755 21 lines (17 sloc) 786 Bytes
a06c1e9 @sundbp updated import of v1 files
authored Nov 19, 2009
1 #!/usr/bin/env /Users/patrik/RubymineProjects/jrbh-worklog/script/runner -e production
2
3 USER = "BH"
4 COMMIT = false
5
6 u = User.find_by_alias("BH")
7 t = WorklogTask.find_by_name("Spring Break")
8 s = Date.new(2009,5,25).to_time
9 e = Date.new(2009,8,17).to_time
10
11 (s..e).step(7.days) do |x|
12 start_t = x.to_time + 9.hours
13 end_t = start_t + 8.hours
14 print "\n(#{start_t}-#{end_t}) #{u.alias} - #{t.name}\n"
15 WorkPeriod.create(:user_id => u.id, :worklog_task_id => t.id, :start => start_t, :end => end_t, :comment => "2days a week import") if COMMIT
16 start_t += 1.day
17 end_t += 1.day
18 print "(#{start_t}-#{end_t}) #{u.alias} - #{t.name}\n"
19 WorkPeriod.create(:user_id => u.id, :worklog_task_id => t.id, :start => start_t, :end => end_t, :comment => "2days a week import") if COMMIT
20 end
Something went wrong with that request. Please try again.