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 #603] Teach RedundantPresenceValidationOnBelongsTo to work with multi-attribute validations #609

Merged
merged 3 commits into from
Dec 31, 2021

Conversation

pirj
Copy link
Member

@pirj pirj commented Dec 30, 2021

fixes #603


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • 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.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • [-] If this is a new cop, consider making a corresponding update to the Rails Style Guide.

@pirj pirj force-pushed the fix-603-multi-attribute-validation branch from 15c92a2 to cf8a307 Compare December 31, 2021 07:55
@koic
Copy link
Member

koic commented Dec 31, 2021

Although not directly related to this PR change, can you suppress the following yard doc warning?

% bundle exec rake
(snip)

[warn]: @param tag has unknown parameter name: key
    in file `lib/rubocop/cop/rails/redundant_presence_validation_on_belongs_to.rb' near line 133

@pirj pirj force-pushed the fix-603-multi-attribute-validation branch from cf8a307 to 1d7a9ed Compare December 31, 2021 10:28
@pirj
Copy link
Member Author

pirj commented Dec 31, 2021

@param tag has unknown parameter name: key

Thanks for noticing, this warning evaded me. Fixed.

@koic koic merged commit 17ebff7 into rubocop:master Dec 31, 2021
@koic
Copy link
Member

koic commented Dec 31, 2021

Thanks!

@pirj pirj deleted the fix-603-multi-attribute-validation branch January 1, 2022 14:23
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/RedundantPresenceValidationOnBelongsTo removes other validations on the same line
2 participants