Skip to content

Cop to check for duplicate scopes #427

Closed
@dvandersluis

Description

I accidentally wrote the following code:

scope :visible, -> { where(visible: true) }
scope :hidden, -> { where(visible: true) }

It'd be great to detect that the same scope is defined twice, because this most likely is always an error.

Describe the solution you'd like

Register an offense when multiple scopes have identical bodies.

Describe alternatives you've considered

N/A

Additional context

N/A

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