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 not auto-corrected for Rails/DuplicateAssociation #703

Merged
merged 1 commit into from
May 11, 2022

Conversation

ydah
Copy link
Member

@ydah ydah commented May 11, 2022

This PR is fixed not auto-corrected case for Rails/DuplicateAssociation

The following problems that could'nt be corrected automatically
when exactly the same association was defined have been resolved.

class Post < ApplicationRecord
  belongs_to :foo
  belongs_to :bar
  belongs_to :foo
end

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.

This PR is fixed not auto-corrected case for `Rails/DuplicateAssociation`

The following problems that could'nt be corrected automatically
when exactly the same association was defined have been resolved.

```ruby
class Post < ApplicationRecord
  belongs_to :foo
  belongs_to :bar
  belongs_to :foo
end
```
@ydah ydah force-pushed the fix_duplicate_association branch from 7f74017 to 98bd282 Compare May 11, 2022 06:47
@ydah ydah marked this pull request as ready for review May 11, 2022 06:56
@koic koic merged commit 7e173fd into rubocop:master May 11, 2022
@koic
Copy link
Member

koic commented May 11, 2022

Thanks!

@ydah ydah deleted the fix_duplicate_association branch May 11, 2022 19:25
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.

2 participants