Adding indexes on :position and [[:depth, :asc], [:position, :asc]] to avoid Mongo::OperationFailure: too much data for sort() with no index

This commit is contained in:
Benjamin Quorning 2011-08-09 15:07:15 +03:00
parent 333934c022
commit e2eb8f2e90

View File

@ -10,6 +10,10 @@ module Extensions
## fields ## ## fields ##
field :position, :type => Integer field :position, :type => Integer
## indexes ##
index :position
index [[:depth, :asc], [:position, :asc]]
## behaviours ## ## behaviours ##
acts_as_tree :order => ['position', 'asc'] acts_as_tree :order => ['position', 'asc']