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

DuplicateAssociation is not (yet?) safe correctable. #1356

Open
nroose opened this issue Sep 6, 2024 · 5 comments
Open

DuplicateAssociation is not (yet?) safe correctable. #1356

nroose opened this issue Sep 6, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@nroose
Copy link

nroose commented Sep 6, 2024

Be clear, concise and precise in your description of the problem.
Open an issue with a descriptive title and a summary in grammatically correct,
complete sentences.

Use the template below when reporting bugs. Please, make sure that
you're running the latest stable RuboCop and that the problem you're reporting
hasn't been reported (and potentially fixed) already.

Before filing the ticket you should replace all text above the horizontal
rule with your own words.


Expected behavior

Remove the later copy.

Actual behavior

Removed the earlier copy.

Steps to reproduce the problem

Create duplicate associations in a model file and use it between them.

RuboCop version

1.66.1 (using Parser 3.3.5.0, rubocop-ast 1.32.3, running on ruby 3.3.4) [arm64-darwin23]

  • rubocop-performance 1.18.0
  • rubocop-rails 2.19.1
  • rubocop-rspec 2.29.2
@Earlopain
Copy link
Contributor

Can you provide code samples? There is not much to go on here.

Please also upgrade rubocop-rails first and check if the issue still occurs. It is more than one year out of date.

@koic
Copy link
Member

koic commented Sep 11, 2024

I'm going to close this issue, but feel free to reopen it with reproducible steps.

@koic koic closed this as completed Sep 11, 2024
@nroose
Copy link
Author

nroose commented Sep 21, 2024

class Test < ApplicationRecord
  belongs_to :toast, optional: true
  alias taste toast
  belongs_to :toast, optional: true
end

@nroose
Copy link
Author

nroose commented Sep 21, 2024

Can not seem to reopen.

@nroose
Copy link
Author

nroose commented Sep 21, 2024

Please just remove the later one.

@koic koic reopened this Sep 21, 2024
@koic koic added the bug Something isn't working label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants