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 70 70: def bound_variable_arg(arg, conn) 71: case arg 72: when Sequel::Model 73: "(#{arg.values.values_at(*arg.columns).map{|v| bound_variable_array(v)}.join(COMMA)})" 74: else 75: super 76: end 77: 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 81 81: def row_type(db_type, v) 82: if v.is_a?(Sequel::Model) 83: v 84: else 85: super 86: end 87: end