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

[Fix #221] Make Rails/UniqueValidationWithoutIndex aware of add_index #222

Conversation

koic
Copy link
Member

@koic koic commented Mar 28, 2020

Fixes #221.

This PR makes Rails/UniqueValidationWithoutIndex aware of add_index in db/schema.rb.

Rails 4.0 and Rails 4.1 support will drop shortly, but Rails 4.2 may be a bit ahead. There may be changes to these support after the bug fix release of RoboCop Rails 2.5 series.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@koic koic force-pushed the make_unique_validation_without_index_aware_of_add_index branch 2 times, most recently from 41c6eaa to a77506a Compare March 29, 2020 06:27
…`add_index`

Fixes rubocop#221.

This PR makes `Rails/UniqueValidationWithoutIndex` aware of `add_index`
in db/schema.rb.

Rails 4.0 and Rails 4.1 support will drop shortly, but Rails 4.2
may be a bit ahead. There may be changes to these support after
the bug fix release of RoboCop Rails 2.5 series.
@koic koic force-pushed the make_unique_validation_without_index_aware_of_add_index branch from a77506a to 3fa9c7c Compare March 29, 2020 11:25
@koic koic merged commit ad4e97d into rubocop:master Mar 31, 2020
@koic koic deleted the make_unique_validation_without_index_aware_of_add_index branch March 31, 2020 01:55
koic added a commit to koic/rubocop-rails that referenced this pull request Apr 21, 2020
Follow up to rubocop#222.

This PR drops support for Rails 4.1 or lower.

RuboCop Rails 2.6 will drop support for Rails 4.1 or lower.
Maybe RuboCop Rails 3.0 will drop Rails 4 series support in future.
RuboCop Rails is currently negative support for Rails 4 series,
and new features for Rails 4 will basically not be accepted.
@koic koic mentioned this pull request Apr 21, 2020
8 tasks
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.

Rails/UniqueValidationWithoutIndex: False positive when there's no t.index
1 participant