module Sequel::Dataset::AutoLiteralStrings

  1. lib/sequel/extensions/auto_literal_strings.rb

Methods

Public Instance

  1. filter_expr
  2. update_sql

Public Instance methods

filter_expr(expr = nil)

Treat plain strings as literal strings, and arrays where the first element is a string as a literal string with placeholders.

[show source]
   # File lib/sequel/extensions/auto_literal_strings.rb
41 def filter_expr(expr = nil)
42   case expr
43   when LiteralString
44     super
45   when String
46     super(LiteralString.new(expr))
47   when Array
48     if (sexpr = expr.first).is_a?(String)
49       super(SQL::PlaceholderLiteralString.new(sexpr, expr[1..-1], true))
50     else
51       super
52     end
53   else
54     super
55   end
56 end
update_sql(values=OPTS)

Treat plain strings as literal strings.

[show source]
   # File lib/sequel/extensions/auto_literal_strings.rb
59 def update_sql(values=OPTS)
60   case values
61   when LiteralString
62     super
63   when String
64     super(LiteralString.new(values))
65   else
66     super
67   end
68 end