From 3706249d069552c8dd00789c6457fc40d0b32af7 Mon Sep 17 00:00:00 2001 From: Gary Greyling Date: Fri, 21 Sep 2012 11:47:33 +0200 Subject: [PATCH] fix #siblings when no :order was specified --- lib/closure_tree/acts_as_tree.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/closure_tree/acts_as_tree.rb b/lib/closure_tree/acts_as_tree.rb index e7602412..4db88e9e 100644 --- a/lib/closure_tree/acts_as_tree.rb +++ b/lib/closure_tree/acts_as_tree.rb @@ -182,7 +182,7 @@ def descendant_ids def self_and_siblings s = ct_base_class.where(parent_column_sym => parent) - quoted_order_column ? s.order(quoted_order_column) : s + order_option.present? ? s.order(quoted_order_column) : s end def siblings