diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-11-09 12:50:35 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-11-09 12:50:35 +0000 |
commit | bc7ec23f4ef9ee5f8a8e7ec7b17af6652e4d438e (patch) | |
tree | 297555e2953ab305096c57c984c532f30af5ef7f /activerecord/lib/active_record/acts | |
parent | e6f412def3ec9defcc1a97d1d9c4a8880b18d624 (diff) | |
download | rails-bc7ec23f4ef9ee5f8a8e7ec7b17af6652e4d438e.tar.gz rails-bc7ec23f4ef9ee5f8a8e7ec7b17af6652e4d438e.tar.bz2 rails-bc7ec23f4ef9ee5f8a8e7ec7b17af6652e4d438e.zip |
Fixed acts_as_list for definitions without an explicit :order #2803 [jonathan@bluewire.net.nz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2951 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/acts')
-rw-r--r-- | activerecord/lib/active_record/acts/tree.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/acts/tree.rb b/activerecord/lib/active_record/acts/tree.rb index 1c7646b74c..e4ab8cd708 100644 --- a/activerecord/lib/active_record/acts/tree.rb +++ b/activerecord/lib/active_record/acts/tree.rb @@ -49,10 +49,10 @@ module ActiveRecord module_eval <<-END def self.roots - self.find(:all, :conditions => "#{configuration[:foreign_key]} IS NULL", :order => "#{configuration[:order]}") + self.find(:all, :conditions => "#{configuration[:foreign_key]} IS NULL", :order => #{configuration[:order].nil? ? "nil" : %Q{"#{configuration[:order]}"}}) end def self.root - self.find(:first, :conditions => "#{configuration[:foreign_key]} IS NULL", :order => "#{configuration[:order]}") + self.find(:first, :conditions => "#{configuration[:foreign_key]} IS NULL", :order => #{configuration[:order].nil? ? "nil" : %Q{"#{configuration[:order]}"}}) end END |