Skip to content

Commit

Permalink
Doesn't allow a match option other then :any or :all
Browse files Browse the repository at this point in the history
  • Loading branch information
mauriciozaffari committed Sep 17, 2010
1 parent 423870b commit 8fad1d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoid_search/mongoid_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module ClassMethods #:nodoc:
# Set a field or a number of fields as sources for search
def search_in(*args)
options = args.last.is_a?(Hash) && (args.last.keys.first == :match) ? args.pop : {}
self.match = options[:match] || :any
self.match = [:any, :all].include?(options[:match]) ? options[:match] : :any
self.search_fields = args

field :_keywords, :type => Array
Expand Down

0 comments on commit 8fad1d6

Please sign in to comment.