Skip to content

Commit

Permalink
Merge pull request #26102 from gsamokovarov/schema-statements-typo
Browse files Browse the repository at this point in the history
Fix a NoMethodError schema_statements.rb
  • Loading branch information
senny committed Aug 10, 2016
1 parent 1fd1fc3 commit aa05592
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Expand Up @@ -1210,7 +1210,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
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

0 comments on commit aa05592

Please sign in to comment.