Skip to content

Commit 3c194d4

Browse files
arthurnnrafaelfranca
authored andcommitted
Fix test/cases/adapters/postgresql/bytea_test after ed2b4eb
1 parent 66e5dc4 commit 3c194d4

File tree

1 file changed

+1
-1
lines changed
  • activerecord/lib/active_record/connection_adapters/postgresql

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/connection_adapters/postgresql/oid.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def type_cast(value)
3333
return if value.nil?
3434
# This is a flawed heuristic, but it avoids truncation;
3535
# we really shouldn’t be calling this with already-unescaped values
36-
return value if value =~ /\x00/
36+
return value if value.dup.force_encoding("BINARY") =~ /\x00/
3737
PGconn.unescape_bytea value
3838
end
3939
end

0 commit comments

Comments
 (0)