Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 14:39
    davydovanton commented #34
  • 14:24
    dry-bot commented #34
  • 14:19
    davydovanton synchronize #34
  • 14:19

    davydovanton on performance-improvements-for-rack-monitorring

    Improve memory allocation for R… (compare)

  • 14:17

    davydovanton on runtime-deps

    (compare)

  • 14:17

    davydovanton on master

    Fix dry-events dependency in th… Merge pull request #36 from dry… (compare)

  • 14:17
    davydovanton closed #36
  • 14:15
    davydovanton opened #36
  • 14:15

    davydovanton on runtime-deps

    Fix dry-events dependency in th… (compare)

  • 10:59
    solnic commented #35
  • 10:50
    flash-gordon commented #35
  • 10:43
    davydovanton synchronize #34
  • 10:43

    davydovanton on performance-improvements-for-rack-monitorring

    Improve memory allocation for R… (compare)

  • 10:27

    dry-bot on master

    [devtools] sync (compare)

  • 10:27

    solnic on broken-master

    (compare)

  • 10:27

    solnic on master

    Fix dry-event version in runtim… Merge pull request #35 from dry… (compare)

  • 10:27
    solnic closed #35
  • Mar 31 19:45
    davydovanton commented #35
  • Mar 31 19:45
    davydovanton review_requested #35
  • Mar 31 19:45
    davydovanton review_requested #35
Piotr Solnica
@solnic
@dgollahon ^^
this will prepend rules from OneSchema
Daniel Gollahon
@dgollahon
oh, interesting
that's actually exactly what i was asking about
Piotr Solnica
@solnic
if you have more you can do this too:
Dry::Validation.Schema(Dry::Validation::Schema, rules: SomeSchema.class.rules + OtherSchema.class.rules)
so as you can see, it’s awful :laughing:
Daniel Gollahon
@dgollahon
haha
Piotr Solnica
@solnic
there’s an issue about it
Daniel Gollahon
@dgollahon
that last one is a little awkward, yeah
Piotr Solnica
@solnic
well, it’s just not done yet (hence no docs too)
Daniel Gollahon
@dgollahon
but the first case seems potentially useful. i'll have to tinker with it.
yeah
totally understand
Piotr Solnica
@solnic
this is tricky stuff so it’s taking some time
Daniel Gollahon
@dgollahon
yeah, definitely
Piotr Solnica
@solnic
schemas have all sorts of properties, so it’s not just “use inheritance Luke!”
Daniel Gollahon
@dgollahon
but good to know there's an effort about it.
haha, yeah.
Piotr Solnica
@solnic
well, we just need to come up with an API :)
because internals are ready
Daniel Gollahon
@dgollahon
and "use inheritance Luke!" is also not inherently simple.
cool
Piotr Solnica
@solnic
that too :)
schema rules is just an array with rules, so we can append stuff, prepend stuff, compose with others, whatever we want
and since input processors are decoupled, this doesn’t affect the rules at all
furthermore, message compilation is decoupled too, so we can easily tune message settings for a schema that inherits rules from multiple other schemas that have different message settings :)
Daniel Gollahon
@dgollahon
neat, seems great. just time to do some API pondering.
seems like some of the harder parts will be if you have collisions
where both schema A and B operate on key foo.
Piotr Solnica
@solnic
we can do stuff like [a_rules.select { |r| r.name == :foo } + b_rules.select { |r| r.name == :foo }].reduce(:and)
errrr s/select/detect/
this stuff is crazy flexible so we can either do this, or make it configurable, or raise an error, dunno :)
Daniel Gollahon
@dgollahon
yeah. i would expect you could inadvertently get contradictory rules with an and. but maybe that's just your fault and ohwell :P
might be less surprising to raise an error. but i don't know, there may be a reasonable alternative.
Juanma Cervera
@jmcervera
Hi, A question about testing.
I'm developing a dry-system project, where my functional classes are registered in the app container.
I instantiate the objects in specs through the container as I do in the app.
How should I instantiate the subject object when I want to mock some of the dependencies,
with mocks or lambda functions to avoid for example go to the database through a repository?
Should I instantiate the object with new and not use the DI?
Is there a way to mock only some of the dependencies and get DI work for the others?
just use .new + kwargs (it’s the default constructor type in autoinject)
Juanma Cervera
@jmcervera
@solnic Thanks :smile:
Sergey Novikov
@droptheplot
Hi there! Looks like a have a similar questions but don't know where to start. I'm using containers in my application and currently calling them like container['somenamespace.somecontainer'].call within my specs. The questions is how to use auto_inject inside specs?
Jānis Miezītis
@janjiss
Hey folks, I created a gem main purpose of which is to map data from unformated hash (In my case from CSV rows) and turn it to some usable domain objects and to add dry-types as a basis for type checks. https://github.com/janjiss/massager
Piotr Solnica
@solnic
@janjiss oh cool I’ll check it out. thanks for sharing
Jānis Miezītis
@janjiss
@solnic On which time zone are you? Are you in Krakow or in US atm?
Just curiosity - Since your work hours look more like US, but under profile there is Krakow :D
Piotr Solnica
@solnic
@janjiss US atm
Christopher Dennl-Ortega Arrieta
@cdennl
@solnic Is it allowed to have multiple predicates( My::Predicates ) statements in the config block auf a schema?
Piotr Solnica
@solnic
@cdennl it’s config.predicates = YourPredicates since 0.9.x
or 0.8.0 O_o can’t remember exactly
oh and no, it doesn’t support more than one predicate module, at least not yet
Christopher Dennl-Ortega Arrieta
@cdennl
it is predicates(...) in 0.9+ :) and thank you I saw that only one is working at the moment