Browse files

Updated #arrange to use ActiveSupport::OrderedHash so ordering also w…

…orks in Ruby 1.8.
  • Loading branch information...
muitocomplicado authored and stefankroes committed Mar 11, 2010
1 parent 067fa51 commit fa730966d92a03e7c6f9e1be2c1cf1d2845a3b2e
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/ancestry/class_methods.rb
@@ -36,7 +36,7 @@ def arrange options = {}
self.base_class.ordered_by_ancestry_and options.delete(:order)
# Get all nodes ordered by ancestry and start sorting them into an empty hash
- scope.all(options).inject({}) do |arranged_nodes, node|
+ scope.all(options).inject( do |arranged_nodes, node|
# Find the insertion point for that node by going through its ancestors
node.ancestor_ids.inject(arranged_nodes) do |insertion_point, ancestor_id|
insertion_point.each do |parent, children|

0 comments on commit fa73096

Please sign in to comment.