Remove position from an issue when it is changed from a story into a task

pull/6827/head
friflaj 14 years ago
parent 61aa35204e
commit 314271f2b4
  1. 2
      db/migrate/015_order_tasks_using_tree.rb
  2. 13
      db/migrate/016_remove_task_position.rb
  3. 10
      lib/backlogs_issue_patch.rb

@ -1,4 +1,4 @@
class RemoveTaskPosition < ActiveRecord::Migration
class OrderTasksUsingTree < ActiveRecord::Migration
def self.up
last_task = {}
ActiveRecord::Base.transaction do

@ -0,0 +1,13 @@
class RemoveTaskPosition < ActiveRecord::Migration
def self.up
ActiveRecord::Base.transaction do
Task.find(:all, :conditions => "id <> root_id and not position is null").each do |t|
t.remove_from_list
end
end
end
def self.down
raise ActiveRecord::IrreversibleMigration
end
end

@ -161,9 +161,13 @@ module Backlogs
touched_sprint.touch_burndown
end
if ! self.in_list? && self.is_story?
self.insert_at
self.move_to_bottom
if self.in_list?
self.remove_from_list if self.is_task?
else
if self.is_story?
self.insert_at
self.move_to_bottom
end
end
end

Loading…
Cancel
Save