Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Commit

Permalink
fix for saved files
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainer Kuhn committed Aug 18, 2010
1 parent 17d1c2b commit dbc8ce0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/mongoid_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def insert_before( new_child )
new_child.position = self.position
self.parent.children.each do |child|
if child.position >= new_child.position
child.position += 1
child.update_attributes(:position => child.position + 1)
end
end
self.parent.reload.children << new_child
Expand All @@ -95,7 +95,7 @@ def insert_after ( new_child )
new_child.position = self.position + 1
self.parent.children.each do |child|
if child.position >= new_child.position
child.position += 1
child.update_attributes(:position => child.position + 1)
end
end
self.parent.children << new_child
Expand Down

0 comments on commit dbc8ce0

Please sign in to comment.