lib/mongoid-haystack/util.rb in mongoid-haystack-1.1.0 vs lib/mongoid-haystack/util.rb in mongoid-haystack-1.2.0
- old
+ new
@@ -3,11 +3,10 @@
module Util
def models
[
Mongoid::Haystack::Token,
Mongoid::Haystack::Index,
- Mongoid::Haystack::Count,
Mongoid::Haystack::Sequence
]
end
def reset!
@@ -25,9 +24,13 @@
begin
model.create_indexes
rescue Object => e
end
end
+ end
+
+ def create_indexes
+ models.each{|model| model.create_indexes}
end
def destroy_all
models.map{|model| model.destroy_all}
end