These are chat archives for dry-rb/chat

28th
Jan 2016
Piotr Solnica
@solnic
Jan 28 2016 12:29
Class.new(Schema) do
  key(:email).maybe

  key(:settings) do |settings|
    settings.optional(:offers).maybe(:bool?).when(:true?) do
      settings.value(:newsletter).false?
    end

    settings.key(:newsletter).required(:bool?).when(:true?) do
      value(:email).filled?
    end
  end
end
so, this now works too :dancers:
Ralf Schmitz Bongiolo
@mrbongiolo
Jan 28 2016 12:46
this mean that you can only have offers when newsletter is false?
Piotr Solnica
@solnic
Jan 28 2016 13:13
@mrbongiolo yes
Piotr Solnica
@solnic
Jan 28 2016 13:18
I’m gonna improve error msgs / hints for 0.7.0 release too, it’s pretty crucial and it’s a blocker for many people, so it’s important to get it done asap
ie right now error msgs are messed up for nested hashes/arrays :(
so first of all I gotta fix that, then I’ll implement a simple optimization where type-check hints will be dropped when there are other hints/errors, this will make it way better for majority of the cases already
oh and btw I upgraded one app to master with macros, works great
Ralf Schmitz Bongiolo
@mrbongiolo
Jan 28 2016 13:45
Hints will be optional?
Piotr Solnica
@solnic
Jan 28 2016 13:54
no, they should always be used because not all predicates are being applied, so it’s useful to see all requirements for a particular value
Piotr Solnica
@solnic
Jan 28 2016 22:10
dryrb/dry-data#21 <= help-wanted