Skip to content

Commit

Permalink
Use supports_foreign_keys? instead of removed `supports_foreign_key…
Browse files Browse the repository at this point in the history
…s_in_create?`

Follow up of rails/rails#35212.

This PR fixes the following error.

```console
$ bundle exec rspec ./spec/active_record/connection_adapters/oracle_enhanced/connection_spec.rb:179

(snip)

Failures:

  1) OracleEnhancedConnection default_timezone should respect
  default_timezone = :utc than time_zone setting
     Failure/Error: if supports_foreign_keys_in_create?

     NoMethodError:
       undefined method `supports_foreign_keys_in_create?' for
       #<ActiveRecord::ConnectionAdapters::OracleEnhanced::SchemaCreation:0x0000000003ef9108>
       Did you mean?  supports_foreign_keys?
     # ./lib/active_record/connection_adapters/oracle_enhanced/schema_creation.rb:24:in `visit_TableDefinition'
     # /home/vagrant/.rvm/gems/ruby-2.6.0/bundler/gems/rails-8d9d46fdae45/activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb:14:in `accept'
     # ./lib/active_record/connection_adapters/oracle_enhanced/schema_statements.rb:233:in `create_table'
```

https://travis-ci.org/rsim/oracle-enhanced/jobs/492524301#L932
  • Loading branch information
koic committed Feb 13, 2019
1 parent 74f470f commit 916e206
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def visit_TableDefinition(o)
statements = o.columns.map { |c| accept c }
statements << accept(o.primary_keys) if o.primary_keys

if supports_foreign_keys_in_create?
if supports_foreign_keys?
statements.concat(o.foreign_keys.map { |to_table, options| foreign_key_in_create(o.name, to_table, options) })
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,6 @@ def supports_foreign_keys?
true
end

def supports_foreign_keys_in_create?
supports_foreign_keys?
end

def supports_views?
true
end
Expand Down

0 comments on commit 916e206

Please sign in to comment.