From 5e3a9e1bc18b40b7470984ffd281c0304e1631e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Sat, 1 Nov 2008 03:59:13 +0100 Subject: [PATCH] readme: add Thinking Sphinx consideration --- README.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.markdown b/README.markdown index 1aaf58c..6943c34 100644 --- a/README.markdown +++ b/README.markdown @@ -43,6 +43,23 @@ Example usage: Considerations -------------- +### Thinking Sphinx + +Thinking Sphinx inspects the `connection` object to determine the database adapter. +Because masochism works by putting the connection proxy in its place, TS will be confused +about `ActiveReload::ConnectionProxy` and abort. A possible workaround is to monkeypatch TS right to **hardcode** our adapter after masochism has been enabled: + + # ConnectionProxy from masochism confuses TS + ThinkingSphinx::Index.class_eval do + def adapter() :mysql end + end + + ThinkingSphinx::AbstractAdapter.class_eval do + def self.detect(model) + ThinkingSphinx::MysqlAdapter + end + end + ### Litespeed web server If you are using the Litespeed web server, child processes are initialized on creation,