lib/riddle/query.rb in riddle-1.5.6 vs lib/riddle/query.rb in riddle-1.5.7

- old
+ new

@@ -56,14 +56,14 @@ values = "(#{values.join(', ')})" if values.is_a?(Array) "SET#{ ' GLOBAL' if global } #{variable} = #{values}" end def self.snippets(data, index, query, options = nil) - data.gsub!("'") { |x| "\\'" } - query.gsub!("'") { |x| "\\'" } + data = data.gsub("'") { |x| "\\'" } + query = query.gsub("'") { |x| "\\'" } options = ', ' + options.keys.collect { |key| - value = options[key] + value = translate_value options[key] value = "'#{value}'" if value.is_a?(String) "#{value} AS #{key}" }.join(', ') unless options.nil?