Created
March 27, 2010 01:43
-
-
Save secobarbital/345623 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Solr | |
class Connection | |
def post_with_response_debug(request) | |
response = post_without_response_debug(request) | |
if ENV["DEBUG"] | |
puts "-- RESPONSE -------------------" | |
puts response.class | |
puts response.inspect | |
puts "-- END RESPONSE ---------------" | |
end | |
response | |
end | |
alias_method_chain :post, :response_debug | |
end | |
module Response | |
class Ruby | |
def initialize_with_hashify_facets(ruby_code) | |
initialize_without_hashify_facets(ruby_code) | |
@data["facet_counts"] && @data["facet_counts"]["facet_fields"] && @data["facet_counts"]["facet_fields"].each do |k, v| | |
@data["facet_counts"]["facet_fields"][k] = Hash[*v] if v.is_a?(Array) | |
end | |
end | |
alias_method_chain :initialize, :hashify_facets | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment