Skip to content

Commit a8e94b5

Browse files
committed
Merge branch 'master' of git://github.com/vegantech/rails-sqlserver-adapter into vegantech/master
2 parents 994ad89 + 9edb4d3 commit a8e94b5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
# Previous maintainer: Tom Ward <tom@popdog.net>
2525
#
2626

27-
# Current maintainer: Shawn Balestracci <shawn@vegantech.com>
27+
28+
29+
30+
# Current (interim/unofficial) maintainer: Shawn Balestracci <shawn@vegantech.com>
2831

2932
module ActiveRecord
3033
class Base
@@ -213,6 +216,7 @@ def binary_to_string(value)
213216
# Check if the value actually is hex output from the database
214217
# or an Active Record attribute that was just written. If hex, pack the hex
215218
# characters into a string, otherwise return the value
219+
# TODO: This conversion is asymmetrical, and could corrupt data if the original data looked like hex. We need to avoid the guesswork
216220
value =~ /[^[:xdigit:]]/ ? value : [value].pack('H*')
217221
end
218222

@@ -420,7 +424,7 @@ def columns(table_name, name = nil)
420424
AND constraint_column_usage.column_name = columns.column_name
421425
)
422426
WHERE columns.TABLE_NAME = '#{table_name}'
423-
ORDER BY columns.COLUMN_NAME
427+
ORDER BY columns.ordinal_position
424428
}.gsub(/[ \t\r\n]+/,' ')
425429
result = select(sql, name, true)
426430
result.collect do |column_info|

0 commit comments

Comments
 (0)