Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix ancestors method (ordering) #91

Closed
wants to merge 1 commit into from

3 participants

@releu

This fix to prevent bad ordering for models having default order in default_scope.

@jerome

+1 !!

@StefanH
Collaborator

fixed in 2.0 by 8850dca I think

@StefanH StefanH closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 14, 2012
  1. @releu

    fix

    releu authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/ancestry/instance_methods.rb
View
2  lib/ancestry/instance_methods.rb
@@ -74,7 +74,7 @@ def ancestor_conditions
end
def ancestors depth_options = {}
- self.base_class.scope_depth(depth_options, depth).ordered_by_ancestry.scoped :conditions => ancestor_conditions
+ self.base_class.reorder('').scope_depth(depth_options, depth).ordered_by_ancestry.scoped :conditions => ancestor_conditions
end
def path_ids
Something went wrong with that request. Please try again.