Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Piotr Solnica
@solnic
you also have access to very detailed result object with error objects that have all rule results
#messages interface is meant to be used for display purposes, as in - whenever you want to return validation error messages in human-friendly form to the client
for some advanced processing that, let’s say, some library integration may require (like reform), other APIs could be used
Ralf Schmitz Bongiolo
@mrbongiolo
I like messages being simples for messages
since, most of the cases just need straightforward messages
Piotr Solnica
@solnic
yep
Ralf Schmitz Bongiolo
@mrbongiolo
I wouldn't have a problem to use the result object or some other API to implement a different errors object, if it would be needed
BTW, messages show field + message or just the message?
AM:V has that full_messages that add the field directly to the message if needed
Piotr Solnica
@solnic
default messages have %{name} tokens embedded so each message has ‘field’ name too
I really dislike this full_messages API
Ralf Schmitz Bongiolo
@mrbongiolo
yeah, I'm not saying to use it. But just error messages without the field is good when you show the error next to the field
it isn't that bad, but a bit strange to have "name can't be blank" just under the name field itself..
Piotr Solnica
@solnic
you can just provide custom messages and remove %{name} from them
no need for a special API, I think
Ralf Schmitz Bongiolo
@mrbongiolo
uhm
Piotr Solnica
@solnic
we could add an option for that, I’ll wait for feedback
Ralf Schmitz Bongiolo
@mrbongiolo
yeah, better mess with it later on when more people are onboard
to see real usage cases
you could have one schema with fieldless custom messages if needed
the configuration is per schema right?
Piotr Solnica
@solnic
@mrbongiolo it is, yes
you could configure a schema to use a completely different set of error messages
you can also define an abstract app schema with a specific configuration and inherit other schemas from it
Don Morrison
@elskwid
@AMHOL or @solnic - would it be possible to release a new version of dry-pipeline? I’d love to use the Dry::Pipeline.new do syntax in a Rails engine. :grin:
Don Morrison
@elskwid
irb(main):002:0> a = Dry::Pipeline.new {|x| x << "a"}
=> #<Dry::Pipeline:0x000000037af2d0 @fn=#<Proc:0x000000037af280@(irb):2>>
irb(main):003:0> b = Dry::Pipeline.new {|x| x << "b"}
=> #<Dry::Pipeline:0x000000037942a0 @fn=#<Proc:0x00000003794250@(irb):3>>
irb(main):004:0> [a,b].reduce(&:>>).call("foo”)
That’s kind of fun!
Piotr Solnica
@solnic
@elskwid hey Don, too busy with dry-v and then dry-data=>types work to deal with dry-pipeline (I don’t use it anywhere, at least not yet)
Don Morrison
@elskwid
WHATEVER
:)
Piotr Solnica
@solnic
@elskwid want commit/rubygems access? :)
Don Morrison
@elskwid
And what would I do with that? huh? ha ha
Piotr Solnica
@solnic
delete the repo and go for a :beer: :joy:
Don Morrison
@elskwid
There you go trying to drag me into your OSS life.
Piotr Solnica
@solnic
worth a shot
:D
Don Morrison
@elskwid
I’m using pipeline to create a sequence of status checks that accumulates state. It’s perfect for it.
Piotr Solnica
@solnic
that’s good to know
I quickly built it for transflow (but now I switched to call_sheet, which doesn’t use it)
so I don’t have any immediate interest in working on it
Andy Holland
@AMHOL
@solnic I can release if you give me access on rubygems
Piotr Solnica
@solnic
thanks, I’ll do that later today/tomorrow
Andy Holland
@AMHOL
Cool
Vladimir Kochnev
@marshall-lee
@solnic, @elskwid I use dry-pipeline from github.
@solnic and also I posted a PR to dry-pipeline, please review it before releasing. I believe it introduces some right thing
Piotr Solnica
@solnic
lol…I figured out how to optimize hints in a trivial way
dryrb/dry-validation@29e4689 <== seriously :joy:
every left-side-node will produce an error message by applying a predicate…so we can simply skip those, I’m astonished that the solution was that simple
@marshall-lee sure, and thanks for that, my time is limited so I can’t handle this for now. I’m happy to hand it over in general
Vladimir Kochnev
@marshall-lee
@AMHOL, @solnic I also have an idea for dry-pipeline to make it more like Elixir's pipe operator. now it's hard to use dry-pipeline with callable objects with more than one argument. I think that it'd be cool to have the ability to bind all arguments except first.