File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 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
2932module 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 |
You can’t perform that action at this time.
0 commit comments