lib/thinking_sphinx/source.rb in warp-thinking-sphinx-1.2.12 vs lib/thinking_sphinx/source.rb in warp-thinking-sphinx-1.3.10

- old
+ new

@@ -31,34 +31,35 @@ add_internal_attributes_and_facets end def name - @model.sphinx_name + index.name end - def to_riddle_for_core(offset, index) + def to_riddle_for_core(offset, position) source = Riddle::Configuration::SQLSource.new( - "#{name}_core_#{index}", adapter.sphinx_identifier + "#{index.core_name}_#{position}", adapter.sphinx_identifier ) set_source_database_settings source set_source_attributes source, offset - set_source_sql source, offset set_source_settings source + set_source_sql source, offset source end - def to_riddle_for_delta(offset, index) + def to_riddle_for_delta(offset, position) source = Riddle::Configuration::SQLSource.new( - "#{name}_delta_#{index}", adapter.sphinx_identifier + "#{index.delta_name}_#{position}", adapter.sphinx_identifier ) - source.parent = "#{name}_core_#{index}" + source.parent = "#{index.core_name}_#{position}" set_source_database_settings source set_source_attributes source, offset, true + set_source_settings source set_source_sql source, offset, true source end @@ -144,9 +145,9 @@ assoc.ancestors }.flatten.uniq end def utf8? - @index.options[:charset_type] == "utf-8" + @index.options[:charset_type] =~ /utf-8|zh_cn.utf-8/ end end end