lib/mao.rb in mao-0.0.5 vs lib/mao.rb in mao-0.0.6
- old
+ new
@@ -38,10 +38,14 @@
# Escape +value+ as appropriate for a literal in an SQL statement.
def self.escape_literal(value)
case value
when String
- @conn.escape_literal(value)
+ if @conn.respond_to?(:escape_literal)
+ @conn.escape_literal(value)
+ else
+ "'#{@conn.escape_string(value)}'"
+ end
when NilClass
"null"
when TrueClass
"true"
when FalseClass