Module | Sequel::Plugins::PgRow::DatabaseMethods |
In: |
lib/sequel/plugins/pg_row.rb
|
ESCAPE_RE | = | /("|\\)/.freeze |
ESCAPE_REPLACEMENT | = | '\\\\\1'.freeze |
COMMA | = | ',' |
Handle Sequel::Model instances in bound variables.
# File lib/sequel/plugins/pg_row.rb, line 68 68: def bound_variable_arg(arg, conn) 69: case arg 70: when Sequel::Model 71: "(#{arg.values.values_at(*arg.columns).map{|v| bound_variable_array(v)}.join(COMMA)})" 72: else 73: super 74: end 75: end
If a Sequel::Model instance is given, return it as-is instead of attempting to convert it.
# File lib/sequel/plugins/pg_row.rb, line 79 79: def row_type(db_type, v) 80: if v.is_a?(Sequel::Model) 81: v 82: else 83: super 84: end 85: end