lib/data_table/mongoid.rb in data_table-0.3.6 vs lib/data_table/mongoid.rb in data_table-0.3.7
- old
+ new
@@ -28,14 +28,14 @@
{"$or" => search_fields.map {|field| {field => /#{query}/i} }}
end
end
def _order_by_fields params, fields
- [fields[params[:iSortCol_0].to_i], params[:sSortDir_0]]
+ [fields[params[:iSortCol_0].to_i], params[:sSortDir_0] || "asc"]
end
def _sanitize string
- string.strip.gsub(/([\^\\\/\.\+\*\?\|\[\]\(\)\{\}\$])/) { "\\#{$1}" }
+ string.to_s.strip.gsub(/([\^\\\/\.\+\*\?\|\[\]\(\)\{\}\$])/) { "\\#{$1}" }
end
end
end
end