From 79f958c5057717539bb51ddc2d2fc2b1fa4642e8 Mon Sep 17 00:00:00 2001 From: Didier Lafforgue Date: Tue, 13 Mar 2012 16:37:19 +0100 Subject: [PATCH] create mongoDB indexes for locomotive models without any errors --- app/models/locomotive/extensions/page/tree.rb | 2 +- lib/tasks/locomotive.rake | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/locomotive/extensions/page/tree.rb b/app/models/locomotive/extensions/page/tree.rb index 41adf835..a1f97fa4 100644 --- a/app/models/locomotive/extensions/page/tree.rb +++ b/app/models/locomotive/extensions/page/tree.rb @@ -18,7 +18,7 @@ module Locomotive ## indexes ## index :position - index [:depth.asc, :position.asc] + index [[:depth, Mongo::ASCENDING], [:position, Mongo::ASCENDING]] end module ClassMethods diff --git a/lib/tasks/locomotive.rake b/lib/tasks/locomotive.rake index bcd10005..e022978e 100644 --- a/lib/tasks/locomotive.rake +++ b/lib/tasks/locomotive.rake @@ -60,4 +60,5 @@ namespace :locomotive do end end + end