lib/search_party.rb in laserlemon-search_party-0.3.3 vs lib/search_party.rb in laserlemon-search_party-0.4.0
- old
+ new
@@ -22,10 +22,10 @@
def parse_hash(hash)
hash.symbolize_keys.inject({}) do |new_hash, (key, value)|
parsed_value = case value
when Hash then parse_hash(value)
when Array then value.map{|v| parse_value(v) }
- else parse_value(v)
+ else parse_value(value)
end
new_value = if model_name = self.class.search_parameter_models[key]
model = model_name.to_s.classify.constantize
finder = self.class.search_parameter_finders[key]
new_values = [*parsed_value].map{|v| model.send(finder, v) }