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

Accept columns passed with options in remove_index #37168

Merged

Conversation

eugeneius
Copy link
Member

Before this patch, column names could only be passed as a positional argument when no other options were supplied:

remove_index :reports, :report_id

Passing column names positionally along with other options would fail:

remove_index :reports, :report_id, unique: true
# => ArgumentError: wrong number of arguments (given 3, expected 1..2)

This inconsistency was noted before in #29432.

Before this patch, column names could only be passed as a positional
argument when no other options were supplied:

    remove_index :reports, :report_id

Passing column names positionally along with other options would fail:

    remove_index :reports, :report_id, unique: true
    # => ArgumentError: wrong number of arguments (given 3, expected 1..2)
@kaspth kaspth merged commit da54c73 into rails:master Sep 10, 2019
koic added a commit to koic/oracle-enhanced that referenced this pull request Sep 11, 2019
kamipo added a commit that referenced this pull request Jan 27, 2020
#37168 is not backported to 6-0-stable.

[ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants