Skip to content

Commit ed474fb

Browse files
authored
Unique is expected to be a boolean (#1098)
1 parent 3777248 commit ed474fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ def indexes(table_name)
3939
data.reduce([]) do |indexes, index|
4040
index = index.with_indifferent_access
4141

42-
if index[:index_description] =~ /primary key/
42+
if index[:index_description].match?(/primary key/)
4343
indexes
4444
else
4545
name = index[:index_name]
46-
unique = index[:index_description] =~ /unique/
46+
unique = index[:index_description].match?(/unique/)
4747
where = select_value("SELECT [filter_definition] FROM sys.indexes WHERE name = #{quote(name)}", "SCHEMA")
4848
orders = {}
4949
columns = []

0 commit comments

Comments
 (0)