Permalink
Browse files

Fix failing spec in Ruby 1.8.7...

compact_conditions "should remove conditions with blank values". In Ruby 1.9, Hash#select returns a hash, but in 1.8, it returns an array of key/value pair arrays.
  • Loading branch information...
1 parent 3958111 commit a56519f734c5a258262cf59a905fa7036d9caefa @johndouthat committed Mar 22, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 README.rdoc
  2. +1 −1 lib/searchlogic/search/conditions.rb
View
@@ -2,7 +2,7 @@
Searchlogic makes using ActiveRecord named scopes easier and less repetitive. It helps keep your code DRY, clean, and simple.
-The specs pass with ActiveRecord 2.3.9 - 2.3.14 on Ruby 1.9.3-p125 and 1.9.2-p318
+The specs pass with ActiveRecord 2.3.9 - 2.3.14 on Ruby 1.9.3-p125, 1.9.2-p318, and 1.8.7-p358
== Helpful links
@@ -7,7 +7,7 @@ def conditions
end
def compact_conditions
- conditions.select { |k,v| !v.blank? }
+ Hash[conditions.select { |k,v| !v.blank? }]
end
# Accepts a hash of conditions.

0 comments on commit a56519f

Please sign in to comment.