Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Apr 09 12:23
    k0va1 starred dry-rb/dry-container
  • Apr 09 08:33

    dry-bot on master

    [devtools] sync (compare)

  • Apr 09 08:33

    solnic on master

    Update changelog.yml (compare)

  • Apr 09 08:21

    solnic on v0.3.2

    Bump dry-monitor to 0.3.2 (compare)

  • Apr 09 08:20
    flash-gordon commented #38
  • Apr 09 08:19

    dry-bot on master

    [devtools] sync (compare)

  • Apr 09 08:19

    solnic on master

    Update changelog.yml rubocop --safe-auto-correct Ignore warnings from rouge gem and 1 more (compare)

  • Apr 09 08:03
    mensfeld commented #38
  • Apr 09 02:41
    DaiAoki starred dry-rb/dry-monads
  • Apr 08 23:53

    davydovanton on improve-allocation-of-logger

    (compare)

  • Apr 08 23:53

    davydovanton on master

    Don't create a new formatter ob… Merge pull request #38 from dry… (compare)

  • Apr 08 23:53
    davydovanton closed #38
  • Apr 08 18:00
    dry-bot commented #38
  • Apr 08 17:59
    davydovanton review_requested #38
  • Apr 08 17:59
    davydovanton assigned #38
  • Apr 08 17:59
    davydovanton opened #38
  • Apr 08 17:54

    davydovanton on improve-allocation-of-logger

    Don't create a new formatter ob… (compare)

  • Apr 08 17:29
    JuPlutonic starred dry-rb/dry-monitor
  • Apr 08 13:48
  • Apr 08 09:13

    solnic on release-0.17

    Add information about built-in … (compare)

Christopher Dennl-Ortega Arrieta
@cdennl
with xor
Joshua Wilcox
@joshuaswilcox
yeah both optional
Christopher Dennl-Ortega Arrieta
@cdennl
its a common case
Joshua Wilcox
@joshuaswilcox
xor doesn't work for me either
Christopher Dennl-Ortega Arrieta
@cdennl
can you give me your code please the complete one
Joshua Wilcox
@joshuaswilcox
 @schema = Dry::Validation.Form do
        optional(:user_id).maybe(:int?)
        optional(:global_auth_id).maybe(:str?)

        rule(valid_user: [:user_id, :global_auth_id]) do |user_id, global_auth_id|
          user_id.filled? or global_auth_id.filled?
        end
      end
Christopher Dennl-Ortega Arrieta
@cdennl
xor
doesnt work?
or ^
Joshua Wilcox
@joshuaswilcox
ArgumentError: +xor+ is not a valid predicate name
Christopher Dennl-Ortega Arrieta
@cdennl
user_id.filled? ^ global_auth_id.filled?
or user_id.filled?.xor( global_auth_id.filled? )
Joshua Wilcox
@joshuaswilcox
yeah ^ worked
Thanks for the help!
Christopher Dennl-Ortega Arrieta
@cdennl
no problem, so the complete problem is solved?
another solution would have been: (user_id.filled? & global_id.none?) | (user_id.none? & global_id.filled?) that would be the xor expanded
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