Skip to content

Commit 8648d7e

Browse files
committed
Merged jrafanie's merges, and added a comment about asymmetrical binary conversion
1 parent ebc0605 commit 8648d7e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ def binary_to_string(value)
213213
# Check if the value actually is hex output from the database
214214
# or an Active Record attribute that was just written. If hex, pack the hex
215215
# characters into a string, otherwise return the value
216+
# TODO: This conversion is asymmetrical, and could corrupt data if the original data looked like hex. We need to avoid the guesswork
216217
value =~ /[^[:xdigit:]]/ ? value : [value].pack('H*')
217218
end
218219

0 commit comments

Comments
 (0)