Commit 22a00fe2ea8279fdd80876dfa6cdc2d293d915fe

Authored by Austin Smith
1 parent fcde5d1fdd
Exists in master

fixing dual-update issue

Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff

app/controllers/my_taskboard_controller.rb View file @ 22a00fe
... ... @@ -48,9 +48,7 @@
48 48 params[:sort].each do |issue_id|
49 49 unless used_ids.include? issue_id
50 50 used_ids << issue_id
51   - tba = TaskBoardAssignee.first_or_create(:issue_id => issue_id, :assignee_id => @user.id)
52   - tba.weight = weight
53   - tba.save
  51 + tba = TaskBoardAssignee.where(:issue_id => issue_id, :assignee_id => @user.id).first_or_create(:weight => weight)
54 52 weight += 1
55 53 end
56 54 end