From e2eb8f2e905e7c4555e3f71667e4c495fdc75bf9 Mon Sep 17 00:00:00 2001 From: Benjamin Quorning Date: Tue, 9 Aug 2011 15:07:15 +0300 Subject: [PATCH] Adding indexes on :position and [[:depth, :asc], [:position, :asc]] to avoid Mongo::OperationFailure: too much data for sort() with no index --- app/models/extensions/page/tree.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models/extensions/page/tree.rb b/app/models/extensions/page/tree.rb index 2264023f..6970269a 100644 --- a/app/models/extensions/page/tree.rb +++ b/app/models/extensions/page/tree.rb @@ -10,6 +10,10 @@ module Extensions ## fields ## field :position, :type => Integer + ## indexes ## + index :position + index [[:depth, :asc], [:position, :asc]] + ## behaviours ## acts_as_tree :order => ['position', 'asc']