Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #38 from ggennrich/master

Fixed mongoid_search to work with mongoid 3.0rc
  • Loading branch information...
commit 61cebb0db8f2de1b7a28fd59cc53929c23f88b5e 2 parents 258e9b3 + 7ff78f8
@mauriciozaffari authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/mongoid_search/mongoid_search.rb
View
3  lib/mongoid_search/mongoid_search.rb
@@ -26,7 +26,8 @@ def search_in(*args)
self.search_fields = (self.search_fields || []).concat args
field :_keywords, :type => Array
- index :_keywords, :background => true
+
+ Gem.loaded_specs["mongoid"].version.to_s.include?("3.0") ? (index({_keywords: 1}, {background: true})) : (index :_keywords, :background => true)
before_save :set_keywords
end
Please sign in to comment.
Something went wrong with that request. Please try again.