Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 10:40
    qortex commented #400
  • 08:47
    flash-gordon closed #400
  • 08:47
    flash-gordon commented #400
  • Apr 03 21:18
    qortex starred dry-rb/dry-types
  • Apr 03 21:14
    qortex edited #400
  • Apr 03 21:14
    qortex labeled #400
  • Apr 03 21:14
    qortex opened #400
  • Apr 03 19:18
    landongrindheim commented #74
  • Apr 02 19:47
    kamilski81 starred dry-rb/dry-monads
  • Apr 02 17:26
    waleedasif322 starred dry-rb/dry-types
  • Apr 02 14:59
    sskylar starred dry-rb/dry-monads
  • Apr 02 13:51
    kirin121 starred dry-rb/dry-container
  • Apr 02 10:56

    davydovanton on performance-improvements-for-rack-monitorring

    (compare)

  • Apr 02 10:55

    davydovanton on master

    Improve memory allocation for R… Merge pull request #34 from dry… (compare)

  • Apr 02 10:55
    davydovanton closed #34
  • Apr 02 02:25
    DaiAoki starred dry-rb/dry-types
  • Apr 01 14:39
    davydovanton commented #34
  • Apr 01 14:24
    dry-bot commented #34
  • Apr 01 14:19
    davydovanton synchronize #34
  • Apr 01 14:19

    davydovanton on performance-improvements-for-rack-monitorring

    Improve memory allocation for R… (compare)

Joshua Wilcox
@joshuaswilcox
ah good to know thanks! yeah problem solved from a validation point of view :)
Christopher Dennl-Ortega Arrieta
@cdennl
(and,or,not)x(true,false) defines a complete base of boolean logic, any predicate logic term can be assembled out from these three operations on true,flase
Piotr Solnica
@solnic
@cdennl make both keys optional if that’s your case
Christopher Dennl-Ortega Arrieta
@cdennl
@solnic I have no problem :) just tried to help joshua
Piotr Solnica
@solnic
oh sorry ok cool cool :)
Christopher Dennl-Ortega Arrieta
@cdennl
@solnic what I didnt get, ruley key for error message is optional or mandatory?
Piotr Solnica
@solnic
it’s needed when custom rule name was provided
Christopher Dennl-Ortega Arrieta
@cdennl
alright thanks
Joe Van Dyk
@joevandyk
@solnic no luck on setting config.type_specs = true
Form = Dry::Validation.Form do
end

FormContainer = Dry::Validation.Form do
  configure { config.type_specs = true }
  each { schema Form }
end
Christopher Dennl-Ortega Arrieta
@cdennl
@solnic is it possible to make a own section for rule messages in the error hash like so:
required( :param ).filled(:int?)

rule(check_special: [ :param ]) do |param|
  param.gt?(10)
end

errors should be something like: { param: ["must be filled"], rule: { check_special: ["must definitely be greater than 10 you moron"] } }
It would be nice to have a mechanism to know instantly whether a high-level rule generated the error or primitive statement
however this implies reserving a key in the errors hash
for now I am working around by using a name scheme for highlevel rules, but this feels not clean enough
Piotr Solnica
@solnic
please report issues describing what you need
this way it is easier to handle that
Christopher Dennl-Ortega Arrieta
@cdennl
ok will do that thanks
Christopher Dennl-Ortega Arrieta
@cdennl
@solnic Do I get it right, that validate is like rule, but passes in the actual values and the code block just return true or false?
Piotr Solnica
@solnic
@cdennl yes, it is like defining a predicate method that will be executed in the context of your schema, so its state is available there
Piotr Solnica
@solnic
@dsounded re custom vars in messages, could you report an issue about that? it’s on the 1.0 roadmap but it’s not written down anywhere…
Andrei Andreev
@andreimoment
A question about dry-validation: is it possible to override error messages at runtime?
Considering dry-validation for a form-builder solution where the user would be able to provide custom error messages.
Piotr Solnica
@solnic
@andreimoment not yet. Feel free to report an issue and describe what you need
Andrei Andreev
@andreimoment
thank you
Oskar Szrajer
@gotar
Anyone present on EuRuKo in Sofia?
Kiril Dokh
@dsounded
@solnic dry-rb/dry-validation#259
John Griffin
@john-griffin
dry-transaction question: seems like when I pass step arguments to a transaction it disables all step notifications. It might be because it creates a new instance without the subscriptions attached. Anyone else know about this? Thanks!
Piotr Solnica
@solnic
@john-griffin pls report an issue :)
John Griffin
@john-griffin
@solnic :+1: will PR a failing test
Piotr Solnica
@solnic
that would be even better
Ralf Schmitz Bongiolo
@mrbongiolo
@timriley can I update bundler on dry-transaction, or does it need to be on 1.12.x for any reason? It's failing the builds with Travis
Nikita Shilnikov
@flash-gordon
@mrbongiolo yes, go ahead
Christopher Dennl-Ortega Arrieta
@cdennl
I love the new validation feature @solnic saves me a lot writing of unnecessary predicates to satisfy high level rules, well done
Piotr Solnica
@solnic
@cdennl :) good to know
Aleksandar Radunović
@aradunovic

with input like this:

{ name: “my name”, products: [{ id: 1, quantity: 5 }, { id: 5, quantity: 1 }] }

how can I incorporate each validation for products into:

Form = Dry::Validation.Form do
  required(:name).filled(:str?)
  # products array validation
end

the only example I could find was array as input, but in my case, only one attr is array...

Aleksandar Radunović
@aradunovic
also there is nested data example, but it only shows how to validate simple array of strings
Egor Lynko
@flexoid
@aradunovic try this
required(: products).each do
  schema do
    required(:id).filled(:int?)
    required(:quantity).filled(int?)
  end
end
Aleksandar Radunović
@aradunovic
got it…
required(:products).each do
  required(:id).filled(:int?)
  required(:quantity).filled(int?)
end
@flexoid Thanks for the effort :D
Egor Lynko
@flexoid
if I remember correctly, better to use my version, with schema
as each without schema will not work on latest versions
please, correct me if I'm wrong
Aleksandar Radunović
@aradunovic
it works with 0.10.2
@flexoid I’ll stick with schema do, but maybe @solnic could explain the difference
Piotr Solnica
@solnic
Yes pls use schema whenever you define nested structures
Rafael George
@cored
@solnic @flash-gordon mention that there's still work to be done for having optional dry struct inside dry-validation
what is missing specifically ?
Piotr Solnica
@solnic
It is already optional
In 0.10.x