Giter Club home page Giter Club logo

Comments (2)

malparty avatar malparty commented on August 17, 2024 1

From my understanding, the existing cop is covering only the cases when the association is not a standard/default one, but 80% of our associations are standard ones (unless we use Rails engines, it's more around 60%). In either case, I think having a custom cop that requires the inverse_of explicit argument for ALL the associations might be preferable.

This answer assumes that the remaining 20% of work needed for the custom cop is not too hard of course, if there is any big blocker, we might want to consider (a).

from rails-templates.

Goose97 avatar Goose97 commented on August 17, 2024

@malparty I found an existing Rubocop rule that can achieve this. However, they seem more lax than our rule in Compass. This invalid example is considered valid according to their rule. It is because in this case, Rails can inferred the inverse_of.

So what should we do with this:
a) Use the existing Rails/InverseOf rule
b) If we prefer the explicit version, we can write a custom rule. The implementation is 80% finished (should've Google first 😅)

from rails-templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.