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

Define supports_foreign_tables? in AbstractAdapter #31811

Merged

Conversation

yahonda
Copy link
Member

@yahonda yahonda commented Jan 28, 2018

Summary

This pull request addresses "undefined method supports_foreign_tables?" errors
by setting supports_foreign_tables? method in AbstractAdapter.

Unlike bundle exec rake test, bin/test does not skip adapter specific test files.

Related to #31549

$ cd activerecord
$ bin/test
Using sqlite3
Traceback (most recent call last):
	11: from bin/test:5:in `<main>'
	10: from bin/test:5:in `require_relative'
	 9: from /home/yahonda/git/rails/tools/test.rb:26:in `<top (required)>'
	 8: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:39:in `run'
	 7: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:50:in `load_tests'
	 6: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:50:in `each'
	 5: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:50:in `block in load_tests'
	 4: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:283:in `require'
	 3: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:249:in `load_dependency'
	 2: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:283:in `block in require'
	 1: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:283:in `require'
/home/yahonda/git/rails/activerecord/test/cases/adapters/postgresql/foreign_table_test.rb:6:in `<top (required)>': undefined method `supports_foreign_tables?' for #<ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x000055f3ec3c47c8> (NoMethodError)
Did you mean?  supports_foreign_keys?
$ cd activerecord
$ ARCONN=mysql2 bin/test
Using mysql2
Traceback (most recent call last):
	11: from bin/test:5:in `<main>'
	10: from bin/test:5:in `require_relative'
	 9: from /home/yahonda/git/rails/tools/test.rb:26:in `<top (required)>'
	 8: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:39:in `run'
	 7: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:50:in `load_tests'
	 6: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:50:in `each'
	 5: from /home/yahonda/git/rails/railties/lib/rails/test_unit/runner.rb:50:in `block in load_tests'
	 4: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:283:in `require'
	 3: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:249:in `load_dependency'
	 2: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:283:in `block in require'
	 1: from /home/yahonda/git/rails/activesupport/lib/active_support/dependencies.rb:283:in `require'
/home/yahonda/git/rails/activerecord/test/cases/adapters/postgresql/foreign_table_test.rb:6:in `<top (required)>': undefined method `supports_foreign_tables?' for #<ActiveRecord::ConnectionAdapters::Mysql2Adapter:0x0000563d22f93160> (NoMethodError)
Did you mean?  supports_foreign_keys?
$

@rails-bot
Copy link

r? @georgeclaghorn

(@rails-bot has picked a reviewer for you, use r? to override)

@kamipo kamipo merged commit 970b5e1 into rails:master Jan 28, 2018
@yahonda yahonda deleted the supports_foreign_tables_in_abstract_adapter branch May 31, 2018 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants