lib/data_table/mongoid.rb in data_table-0.3.1 vs lib/data_table/mongoid.rb in data_table-0.3.2
- old
+ new
@@ -14,10 +14,10 @@
def _where_conditions raw_query, search_fields
return if (query = raw_query.gsub(/\//, "")).blank?
if search_fields.size == 1
- terms = query.strip.split(/\s/)
+ terms = query.strip.split(/\s+/)
if terms.size == 1
{search_fields.first => /#{query}/i}
else
{search_fields.first => {"$all" => terms.map {|term| /#{term}/i }}}