Skip to content

Commit

Permalink
Remove position from an issue when it is changed from a story into a …
Browse files Browse the repository at this point in the history
…task
  • Loading branch information
friflaj committed Aug 15, 2010
1 parent 61aa352 commit 314271f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
@@ -1,4 +1,4 @@
class RemoveTaskPosition < ActiveRecord::Migration
class OrderTasksUsingTree < ActiveRecord::Migration
def self.up
last_task = {}
ActiveRecord::Base.transaction do
Expand Down
13 changes: 13 additions & 0 deletions db/migrate/016_remove_task_position.rb
@@ -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
10 changes: 7 additions & 3 deletions lib/backlogs_issue_patch.rb
Expand Up @@ -161,9 +161,13 @@ def task_follows_story
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

Expand Down

0 comments on commit 314271f

Please sign in to comment.