Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed bug: when external methods create an empty conditions string, a…

…n invalid sql is produced.
  • Loading branch information...
commit 196de6aad65b3ef7edcccc8f19257462a9f8697c 1 parent c441ef3
@abenari abenari authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/scoped_search/query_builder.rb
View
2  lib/scoped_search/query_builder.rb
@@ -74,7 +74,7 @@ def build_find_params(options)
else raise ScopedSearch::QueryNotSupported, "Cannot handle #{notification.inspect}: #{value.inspect}"
end
end
- sql = (keyconditions + (sql.nil? ? [] : [sql]) ).map {|c| "(#{c})"}.join(" AND ")
+ sql = (keyconditions + (sql.blank? ? [] : [sql]) ).map {|c| "(#{c})"}.join(" AND ")
# Build hash for ActiveRecord::Base#find for the named scope
find_attributes = {}
find_attributes[:conditions] = [sql] + keyparameters + parameters unless sql.blank?
Please sign in to comment.
Something went wrong with that request. Please try again.