Remove unnecessary `respond_to?(:indexes)` checking #26688

Merged
merged 1 commit into from Oct 28, 2016

Projects

None yet

4 participants

@kamipo
Member
kamipo commented Oct 2, 2016

Currently all adapters (postgresql, mysql2, sqlite3, oracle-enhanced,
and sqlserver) implemented indexes and schema dumper expects
implemented indexes.

https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/schema_dumper.rb#L208

Therefore respond_to?(:indexes) checking is unnecessary.

@kamipo kamipo Remove unnecessary `respond_to?(:indexes)` checking
Currently all adapters (postgresql, mysql2, sqlite3, oracle-enhanced,
and sqlserver) implemented `indexes` and schema dumper expects
implemented `indexes`.

https://github.com/rails/rails/blob/v5.0.0/activerecord/lib/active_record/schema_dumper.rb#L208

Therefore `respond_to?(:indexes)` checking is unnecessary.
444cf0d
@rails-bot

r? @kaspth

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

@kaspth kaspth was assigned by rails-bot Oct 2, 2016
@kaspth
Member
kaspth commented Oct 3, 2016

All our built in adapters may support indexes but that's not guaranteed for other adapters like the Oracle one. Is indexes part of our public API?

Closing for now :)

@kaspth kaspth closed this Oct 3, 2016
@kaspth
Member
kaspth commented Oct 6, 2016 edited

Sure, but what about yet other adapters? Not sure how long our backwards compatibility support cycle is for adapters, but I think we need a changelog entry so they know we now require them to implement indexes.

@kaspth kaspth reopened this Oct 6, 2016
@kaspth kaspth merged commit 86bf5ad into rails:master Oct 28, 2016

2 checks passed

codeclimate Code Climate didn't find any new or fixed issues.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@kaspth
Member
kaspth commented Oct 28, 2016

Sweet, then!

@kamipo kamipo deleted the kamipo:remove_respond_to_indexes branch Oct 28, 2016
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Oct 29, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
3951f70
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Nov 3, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
16d2239
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Nov 6, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
7fb4da5
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Nov 10, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
13f1542
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Nov 20, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
0ef9008
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Nov 27, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
c3b53a2
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Nov 30, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
0f42066
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Dec 11, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
38bf2be
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Dec 24, 2016
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
42751b8
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Jan 3, 2017
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
a975659
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Jan 4, 2017
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
12edddb
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Jan 9, 2017
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
452134d
@kamipo kamipo added a commit to kamipo/rails that referenced this pull request Jan 16, 2017
@kamipo kamipo The `default` arg of `index_name_exists?` makes to optional
The `default` arg of `index_name_exists?` is only used the adapter does
not implemented `indexes`. But currently all adapters implemented
`indexes` (See #26688). Therefore the `default` arg is never used.
36f44d1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment