Skip to content

Commit d940b83

Browse files
committed
remove sort in columns call
1 parent 9792e3a commit d940b83

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,13 @@ def columns(table_name, name = nil)
373373
AND constraint_column_usage.column_name = columns.column_name
374374
)
375375
WHERE columns.TABLE_NAME = '#{table_name}'
376-
ORDER BY columns.ordinal_position
377376
}
377+
#Shawn Balestracci 2008-10-01 There's some debate in how the columns should be sorted. I am choosing to leave them unsorted as that was done in the
378+
#Rails 1.x adapter
379+
#add above the brace ORDER BY columns.ordinal_position
380+
#or ORDER BY columns.column_name
381+
#if you want them sorted differently.
382+
378383
result = select(sql, name, true)
379384
result.collect do |column_info|
380385
# Remove brackets and outer quotes (if quoted) of default value returned by db, i.e:

0 commit comments

Comments
 (0)