Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a NoMethodError schema_statements.rb #26102

Merged
merged 1 commit into from
Aug 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ def index_name_for_remove(table_name, options = {})
checks << lambda { |i| i.columns.join("_and_") == column_names.join("_and_") }
end

raise ArgumentError "No name or columns specified" if checks.none?
raise ArgumentError, "No name or columns specified" if checks.none?

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ def test_remove_index_when_name_is_specified
assert_equal expected, remove_index(:people, name: "index_people_on_last_name", algorithm: :concurrently)
end

def test_remove_index_with_wrong_option
assert_raises ArgumentError do
remove_index(:people, coulmn: :last_name)
end
end

private
def method_missing(method_symbol, *arguments)
ActiveRecord::Base.connection.send(method_symbol, *arguments)
Expand Down