Commit fcde5d1fdd70da4a9ad13acf97b74935452d9165

Authored by Austin Smith
1 parent 2f28683457
Exists in master

fixing dual-update issue

Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff

app/controllers/my_taskboard_controller.rb View file @ fcde5d1
... ... @@ -48,7 +48,9 @@
48 48 params[:sort].each do |issue_id|
49 49 unless used_ids.include? issue_id
50 50 used_ids << issue_id
51   - TaskBoardAssignee.create(:issue_id => issue_id, :assignee_id => @user.id, :weight => weight)
  51 + tba = TaskBoardAssignee.first_or_create(:issue_id => issue_id, :assignee_id => @user.id)
  52 + tba.weight = weight
  53 + tba.save
52 54 weight += 1
53 55 end
54 56 end
assets/javascripts/task_board.js View file @ fcde5d1
... ... @@ -157,8 +157,6 @@
157 157 onUpdate: function(e, ui) {
158 158 // Add or remove 'empty' class
159 159 var list = ui.item.parent();
160   - if (list.attr('id') != 'prioritized') return;
161   -
162 160 if (list.hasClass('empty') && list.find('.card').length > 0) {
163 161 list.removeClass('empty');
164 162 }