Skip to content

Commit 10e9eab

Browse files
committed
The user_options parsing. Works for hash/array. Fixes #535
1 parent ec9705c commit 10e9eab

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v4.2.17
2+
3+
#### Changed
4+
5+
* The `user_options` parsing. Works for hash/array. Fixes #535
6+
7+
18
## v4.2.16
29

310
#### Fixed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.16
1+
4.2.17

lib/active_record/connection_adapters/sqlserver/database_statements.rb

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

155155
def user_options
156156
return {} if sqlserver_azure?
157-
select_rows('dbcc useroptions', 'SCHEMA').reduce(HashWithIndifferentAccess.new) do |values, row|
157+
rows = select_rows('dbcc useroptions', 'SCHEMA')
158+
rows = rows.first if rows.size == 2 && rows.last.empty?
159+
rows.reduce(HashWithIndifferentAccess.new) do |values, row|
158160
if row.instance_of? Hash
159161
set_option = row.values[0].gsub(/\s+/, '_')
160162
user_value = row.values[1]

0 commit comments

Comments
 (0)