Sha256: eba103239a01759ad52f0beaa4b77794e9546a5cabe2f74238722199dfd188b7
Contents?: true
Size: 597 Bytes
Versions: 10
Compression:
Stored size: 597 Bytes
Contents
class ThinkingSphinx::Middlewares::UTF8 < ThinkingSphinx::Middlewares::Middleware def call(contexts) contexts.each do |context| context[:results].each { |row| update_row row } update_row context[:meta] end unless encoded? app.call contexts end private def encoded? ThinkingSphinx::Configuration.instance.settings['utf8'].nil? || ThinkingSphinx::Configuration.instance.settings['utf8'] end def update_row(row) row.each do |key, value| next unless value.is_a?(String) row[key] = ThinkingSphinx::UTF8.encode value end end end
Version data entries
10 entries across 10 versions & 1 rubygems