Skip to content

Commit 6a1e933

Browse files
committed
[postgres] quote fix failure with ColumnDefinition on AR 4.0.6.rc2
1 parent 914c512 commit 6a1e933

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/arjdbc/postgresql/adapter.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,8 @@ def quote(value, column = nil)
825825
when String
826826
return "E'#{escape_bytea(value)}'::bytea" if column.type == :binary
827827
return "xml '#{quote_string(value)}'" if column.type == :xml
828-
if column.respond_to?(:sql_type) && column.sql_type[0, 3] == 'bit'
829-
quote_bit(value)
830-
else super
831-
end
828+
sql_type = column.respond_to?(:sql_type) && column.sql_type
829+
sql_type && sql_type[0, 3] == 'bit' ? quote_bit(value) : super
832830
when Array
833831
if AR4_COMPAT && column.array? # will be always falsy in AR < 4.0
834832
column_class = ::ActiveRecord::ConnectionAdapters::PostgreSQLColumn

0 commit comments

Comments
 (0)