Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 07 14:03

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 10:01
    Travis dry-rb/dry-view (master) errored (636)
  • Dec 07 09:58
    Travis dry-rb/dry-view (master) errored (635)
  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

Tim Riley
@timriley
@soumyaray that's a known issue, and nothing to worry about. We'll be hopefully fixing soon.
Soumya Ray
@soumyaray
@timriley thanks! i started an issue on the repo because i didn't see it listed. i'll close it then?
Tim Riley
@timriley
I dunno, feel free to leave it, we can always close it later.
Jérémie Horhant
@Titinux
Hi. I'm starting to make some experimentation with dry-web-roda and I have a little question. How can I pass arguments to the view renderer ? (like default_encoding: 'utf-8' or escape_html: false) I need the last one because I'm using hamlit which by default escapes html and that break the view rendering inside layout.
Lucas Hosseini
@beauby
@soumyaray I’m getting the same – did you open an issue already?
Soumya Ray
@soumyaray
@beauby yes, they're on it :)
Lucas Hosseini
@beauby
:+1:
alexeymoshkin
@alexeymoshkin

Hi there! How can I change property value, when form.validate depending on value of other property in this form
For example:

property :amount
property :type

if type == 'negative'
  amount = 0 - amount
end

Any solution?

Christopher Dennl-Ortega Arrieta
@cdennl
@alexeymoshkin high level rules, look in the docs
alexeymoshkin
@alexeymoshkin
@cdennl thanks, I will try
Martín Fernández
@bilby91
This message was deleted
Martín Fernández
@bilby91
It it possible to use AutoInject in a rails concern ?
Tim Riley
@timriley
You really want to include it in a class, not in another module.
Ernest Bursa
@swistaczek
Hey guys, did some one tried integrating dry-system with existing rails app?
I would be happy if anyone could share an example, this will be great for boosting my lunch time to dry-rb concept :)
Tim Riley
@timriley
I'm not sure if anyone has an app they can share for this, @swistaczek, but solnic did write a dry-system-rails gem to provide s railtie, so it should be possible.
Martín Fernández
@bilby91
Hey, I’m willing to help on the dry-system for rails too!
George Millo
@georgemillo
Can someone explain to me the difference between hints, errors, and messages in dry-v?
looks like messages = hints + errors, amirite?
but what's the difference between hints and errors?
Christopher Dennl-Ortega Arrieta
@cdennl
@georgemillo one is all messages that can happen, and the other is only messages for errors that actually happened
Martín Fernández
@bilby91
Should I expect the correct coercion for this validations ? The input can be a string like “120” or “1.2"
Dry::Validation.Form do
      optional(:width).maybe { float? | int? }
      optional(:height).maybe { float? | int? }
end
George Millo
@georgemillo
@cdennl I thought so, but there seem to be some inconsistencies there
I'll move it to the discussion forums
Sergey Kukunin
@Kukunin
is there any reason behind the prevention to overwrite attributes in inherited dry-struct ?
currently it has check, that attribute is already defined, and crashes
Nikita Shilnikov
@flash-gordon
@Kukunin I doubt there is any strong reason for this, pls open an issue, will see what Piotr and John will say. I'd personally :+1: for removing this restriction
Tim Riley
@timriley
Yeah, it'd made sense to me to allow attributes to be redefined.
Alexey Zapparov
@ixti
Hi all. Is there a way to define custom coercion type for schema?
I have an endpoint that accepts list of ids separated with comma, so i want to do something like:
schema = Dry::Validation.Form do
  required(:ids) { comma_separated_list? }
end

schema.call({ "ids" => "1,2,3" })["ids"] # => ["1", "2", "3"]
Tim Riley
@timriley
@ixti Sounds like something that type specs (http://dry-rb.org/gems/dry-validation/type-specs/) and a custom type would help you achieve
e.g. something like required(:ids, Types::MyCommaSeparatedList).filled(:array?)
where that MyCommaSeparatedList type would accept string input and coerce it into an array
Alexey Zapparov
@ixti
@timriley mm, yeah. that will definitely work for me indeed. Thanks!
Alexey Zapparov
@ixti
Was it considered change API a bit? like instead of Dry::Validation.Form it would be better to write Dry::Validation::Form.describe imho :D
I'm OK with current API. It just looks a bit awkward to me :D
As awkward as when I see someone uses :: to call method
Christian
@bakku
In dry-validation is there a difference between required(:name) and required(:name).filled?
Andy Holland
@AMHOL
required(:name) means the hash key is required, .filled? means the value must be non-blank
Ralf Schmitz Bongiolo
@mrbongiolo
Is there a way to coerce array values with dry-validation?
Tim Riley
@timriley
@mrbongiolo what sort of thing would you like to achieve?
Ralf Schmitz Bongiolo
@mrbongiolo
@timriley Actually I have a form that sends IDs, but as string, I would like to coerce them to Integer, something like:
optional(:my_ids, [:nil, :array]).each([:nil, :int], :int?)
Tim Riley
@timriley
OK cool. And is this a Dry::Validation.Form schema?
Fran Worley
@fran-worley
@mrbongiolo I use Types::Form::Array.member(Types::Form::Int) works perfectly in my Reform form to do exactly as you describe
Ralf Schmitz Bongiolo
@mrbongiolo
Thanks @fran-worley I'll try this out :)
It worked like a charm!!! Thanks for the help, I had forgotten about the member key on Dry::Types
Tim Riley
@timriley
Can we see your final result, @mrbongiolo? :)
Thanks @fran-worley :)
Ralf Schmitz Bongiolo
@mrbongiolo
Sure @timriley, here it is:
# first I defined my custom Dry Type
module MyApp
  module Types
    include Dry::Types.module
    ArrayOfInts = Types::Form::Array.member(Types::Form::Int)
  end
end

# Then I use it on my Schema
optional(:my_ids, [:nil, MyApp::Types::ArrayOfInts]).each(:int?)
Tim Riley
@timriley
right, very nice :)