Permalink
Browse files

[FIX] Fixed an error where Hash#select behaves a bit unexpectedly on …

…Ruby 1.8
  • Loading branch information...
1 parent 2d3869e commit 68dc8160d0009144ce0c98d5ce26aec1b224645a @karmi karmi committed Nov 29, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/tire/model/search.rb
View
@@ -156,7 +156,7 @@ def to_indexed_json
instance.to_hash.reject {|key,_| key.to_s == 'id' || key.to_s == 'type' }.to_json
else
instance.to_hash.
- select { |key, value| instance.class.tire.mapping.keys.map(&:to_s).include?(key.to_s) }.
+ reject { |key, value| ! instance.class.tire.mapping.keys.map(&:to_s).include?(key.to_s) }.
to_json
end
end

0 comments on commit 68dc816

Please sign in to comment.