Skip to content

Instantly share code, notes, and snippets.

@joshaven
Created November 13, 2010 00:11
Show Gist options
  • Save joshaven/674937 to your computer and use it in GitHub Desktop.
Save joshaven/674937 to your computer and use it in GitHub Desktop.
undefined method `bytesize' fix for thinking-sphinx
From 663b4456656fff3e4bd22c6a9fcf51d898ccbbe0 Mon Sep 17 00:00:00 2001
From: Joshaven Potter <yourtech@gmail.com>
Date: Fri, 12 Nov 2010 19:11:01 -0500
Subject: [PATCH] fix undefined method `bytesize` when sending an object to Search::excerpt_for()
---
lib/thinking_sphinx/search.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/thinking_sphinx/search.rb b/lib/thinking_sphinx/search.rb
index a2c9cc1..3fd8c46 100644
--- a/lib/thinking_sphinx/search.rb
+++ b/lib/thinking_sphinx/search.rb
@@ -273,7 +273,7 @@ module ThinkingSphinx
populate
client.excerpts(
{
- :docs => [string],
+ :docs => [string.to_s],
:words => results[:words].keys.join(' '),
:index => options[:index] || "#{model.source_of_sphinx_index.sphinx_name}_core"
}.merge(options[:excerpt_options] || {})
--
1.6.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment