Description:
change lock syntax to be as of rails 4
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r635:58b977bcebf1 - - 1 file changed: 1 inserted, 1 deleted

@@ -39,25 +39,25
39 39 "inqueue"
40 40 when Task::STATUS_GRADING
41 41 "grading"
42 42 when Task::STATUS_COMPLETE
43 43 "complete"
44 44 end
45 45 end
46 46
47 47 def self.get_inqueue_and_change_status(status)
48 48 task = nil
49 49 begin
50 50 Task.transaction do
51 - task = Task.where(status: Task::STATUS_INQUEUE).where(lock: true).first
51 + task = Task.where(status: Task::STATUS_INQUEUE).lock(true).first
52 52 if task!=nil
53 53 task.status = status
54 54 task.save!
55 55 end
56 56 end
57 57
58 58 rescue
59 59 task = nil
60 60
61 61 end
62 62 task
63 63 end
You need to be logged in to leave comments. Login now