lib/thinking_sphinx/xml/source.rb in ts-xml-1.0.2 vs lib/thinking_sphinx/xml/source.rb in ts-xml-1.0.3
- old
+ new
@@ -1,6 +1,16 @@
module ThinkingSphinx
class Source
+ def initialize_with_oracle_database_configuration(index, options = {})
+ connection = index.model.connection
+ if connection.class.name == "ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter"
+ connection.instance_variable_set(:@config, connection.raw_connection.instance_variable_get(:@config))
+ end
+ initialize_without_oracle_database_configuration(index, options)
+ end
+
+ alias_method_chain :initialize, :oracle_database_configuration
+
def to_riddle_for_core(offset, position)
source = Riddle::Configuration::XMLSource.new(
"#{index.core_name}_#{position}", "xmlpipe2"
)