lib/restful_query/parser.rb in restful_query-0.3.5 vs lib/restful_query/parser.rb in restful_query-0.3.6

- old
+ new

@@ -7,10 +7,10 @@ @exclude_columns = columns_from_options(:exclude, options) @integer_columns = columns_from_options(:integer, options) @map_columns = options[:map_columns] || {} @single_sort = options[:single_sort] || true @default_sort_options = options[:sort_options] || {} - @query = (query || {}).dup + @query = (!query || query.empty? || query.to_s =~ /^\s*$/ ? {} : query).dup @default_sort = options[:default_sort] ? [make_sort(options[:default_sort])] : [] @default_join = @query.delete(:join) || :and extract_sorts_from_conditions map_conditions end