lib/riddle/query.rb in riddle-1.5.1 vs lib/riddle/query.rb in riddle-1.5.2

- old
+ new

@@ -57,10 +57,13 @@ "SET#{ ' GLOBAL' if global } #{variable} = #{values}" end def self.snippets(data, index, query, options = nil) options = ', ' + options.keys.collect { |key| - "#{options[key]} AS #{key}" + value = options[key] + value = "'#{value}'" if value.is_a?(String) + + "#{value} AS #{key}" }.join(', ') unless options.nil? "CALL SNIPPETS('#{data}', '#{index}', '#{query}'#{options})" end