Giter Club home page Giter Club logo

Comments (8)

afuno avatar afuno commented on July 3, 2024 1

Here we are talking about all the checks, and not just about these two. Those two are just examples. In an amicable way it is necessary to introduce new logic. I'll try to provide a draft as soon as possible.

from actor.

afuno avatar afuno commented on July 3, 2024 1

@sunny Draft: #97

from actor.

sunny avatar sunny commented on July 3, 2024

Perhaps this is an ordering issue. It looks like it would make sense to always have type be called before inclusion.

Would changing the order of the checks solve this for you?

from actor.

afuno avatar afuno commented on July 3, 2024

In theory, it is correct to take the first check and fall immediately on it. If the first check passes, then take the second and fall on it. And so on until the end.

from actor.

afuno avatar afuno commented on July 3, 2024

That is, there is not a problem in ordering, but a problem in the positioning of these checks. That is, first need to take the first rule and it doesn’t matter what it is - type or inclusion.

from actor.

afuno avatar afuno commented on July 3, 2024

In theory need to add all the checks to an array and run them in a loop. But I'm not sure. 😬 Need to discuss the approach.

from actor.

sunny avatar sunny commented on July 3, 2024

Oh, I see, you mean that input :currency, type: "String", inclusion: %w[A B] would act differently to input :currency, inclusion: %w[A B], type: "String".

That would make total sense! However it would require rewriting how conditions are applied internally. I’d be happy to accept a pull-request going in this direction.

Or else, a smaller change that would fix this specific problem here would be to place base.include(ServiceActor::Conditionable) before TypeCheckable in lib/service_actor/base.rb.

from actor.

sunny avatar sunny commented on July 3, 2024

Released in v3.6.0 πŸš€

from actor.

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.