You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
beginrequire"bundler/inline"rescueLoadError=>e
$stderr.puts"Bundler version 1.10 or later is required. Please update your Bundler"raiseeendgemfile(true)dosource"https://rubygems.org"# Activate the gem you are reporting the issue against.gem"activerecord","5.0.0.1"gem"pg"endrequire"active_record"require"minitest/autorun"require"logger"# Ensure backward compatibility with Minitest 4Minitest::Test=MiniTest::Unit::TestCaseunlessdefined?(Minitest::Test)# This connection will do for database-independent bug reports.ActiveRecord::Base.establish_connection("postgres://postgres@localhost:5432/test")ActiveRecord::Base.logger=Logger.new(STDOUT)ActiveRecord::Schema.definedocreate_table:users,force: truedo |t|
t.text:emailt.string:tokenendexecute"CREATE UNIQUE INDEX index_users_on_lower_email ON users (LOWER(email))"add_index:users,:token,unique: trueendclassBugTest < Minitest::Testdeftest_remove_indexActiveRecord::Base.connection.remove_index:users,:tokenendend
Expected behavior
I think this should run without throwing any exceptions.
Actual behavior
This throws a NoMethodError exception.
BugTest#test_remove_index:NoMethodError: undefinedmethod`join' for "lower(email)":StringDid you mean? JSON /Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1210:in `blockinindex_name_for_remove' /Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1215:in `block (2 levels) in index_name_for_remove'/Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1215:in`each' /Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1215:in `all?'
/Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1215:in`block in index_name_for_remove' /Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1215:in `select' /Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:1215:in `index_name_for_remove'/Users/ben/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activerecord-5.0.0.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:563:in`remove_index' bug.rb:37:in `test_remove_index'
System configuration
Rails version:
5.0.0.1
Ruby version:
2.3.1
Postgres version:
9.5.0.0
It looks like index_name_for_remove is expecting i.columns to be an array of strings, but in the case of an expression index it is just a string.
Steps to reproduce
Expected behavior
I think this should run without throwing any exceptions.
Actual behavior
This throws a
NoMethodError
exception.System configuration
Rails version:
5.0.0.1
Ruby version:
2.3.1
Postgres version:
9.5.0.0
It looks like
index_name_for_remove
is expectingi.columns
to be an array of strings, but in the case of an expression index it is just a string.This was added in 8ceb883 by @greysteil.
The text was updated successfully, but these errors were encountered: