Skip to content

Cop Idea: DuplicateAssociation cop #599

Closed
@natematykiewicz

Description

Recently we had a few PRs created that defined the same association. They were both in code review at the same time, so both added the association that did not previously exist. When both got merged, we didn't realize that we now had the same association defined twice in 1 model. It would be nice if there were a cop that caught this and pointed it out.

For example:

belongs_to :foo
belongs_to :bar
belongs_to :blah
belongs_to :foo # <----- Duplicate

has_many :somethings

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions