Skip to content

Commit 9bdc6b7

Browse files
committed
The user_options parsing. Works for hash/array. Fixes #535
1 parent dc526c1 commit 9bdc6b7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#### Changed
44

55
* Reduce view information reflection to per table vs. column. Fixes #552
6+
* The `user_options` parsing. Works for hash/array. Fixes #535
67

78

89
## v5.0.2

lib/active_record/connection_adapters/sqlserver/database_statements.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ def use_database(database = nil)
132132

133133
def user_options
134134
return {} if sqlserver_azure?
135-
select_rows('dbcc useroptions', 'SCHEMA').reduce(HashWithIndifferentAccess.new) do |values, row|
135+
rows = select_rows('dbcc useroptions', 'SCHEMA')
136+
rows = rows.first if rows.size == 2 && rows.last.empty?
137+
rows.reduce(HashWithIndifferentAccess.new) do |values, row|
136138
if row.instance_of? Hash
137139
set_option = row.values[0].gsub(/\s+/, '_')
138140
user_value = row.values[1]

0 commit comments

Comments
 (0)