Skip to content

Commit dfb2461

Browse files
authored
Merge pull request rails#26102 from gsamokovarov/schema-statements-typo
Fix a NoMethodError schema_statements.rb
2 parents 13cbe12 + 01fbdb3 commit dfb2461

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ def index_name_for_remove(table_name, options = {})
12081208
checks << lambda { |i| i.columns.join("_and_") == column_names.join("_and_") }
12091209
end
12101210

1211-
raise ArgumentError "No name or columns specified" if checks.none?
1211+
raise ArgumentError, "No name or columns specified" if checks.none?
12121212

12131213
matching_indexes = indexes(table_name).select { |i| checks.all? { |check| check[i] } }
12141214

activerecord/test/cases/adapters/postgresql/active_schema_test.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ def test_remove_index_when_name_is_specified
8181
assert_equal expected, remove_index(:people, name: "index_people_on_last_name", algorithm: :concurrently)
8282
end
8383

84+
def test_remove_index_with_wrong_option
85+
assert_raises ArgumentError do
86+
remove_index(:people, coulmn: :last_name)
87+
end
88+
end
89+
8490
private
8591
def method_missing(method_symbol, *arguments)
8692
ActiveRecord::Base.connection.send(method_symbol, *arguments)

0 commit comments

Comments
 (0)