Using dry-validation and an HTML form, how would you handle a field which can be either a boolean or a comma separated list? It must ultimately map to the same symbol name.
#dry_validations #dryrb
@Sandbagger I'm glad you found that #ruby toy project interesting, the ogpreview was not meant for document #docker with #Rails, but mostly to demonstrate good practices such as Railway Oriented Programming in general and @dry_rb gems in particular.
Also, if you want to go a little bit deeper, you can check the repository for my talk in #RubyConf2022, where it was more about API input validations & in general and #modularity by accident:
#ruby #docker #rails #rubyconf2022 #modularity #dryrb #dryvalidation
Dry Transaction permite que você modele o fluxo de trabalho como uma série de operações independentes. A principal vantagem do Dry Transaction é que ele permite que você mantenha sua lógica de negócios livre de detalhes de implementação. ❤️
Vale apena conhecer. https://dry-rb.org/
#ruby #fp #dry #drymonads #dryrb
I wonder if dry-schema or dry-validation can coerce a String into an Array by splitting the String. I assume I can define a custom type that can do that?
#dryrb
I also wonder what is the best way to raise an exception or log errors returned by dry-validations from within a sidekiq worker? Say somehow malformed data gets passed to MyWorker.perform_async(...) but the MyWorker class validates the data using dry-schema or dry-validation.
#dryrb #sidekiq
I'm also curious how people are using dry-validation/dry-schema/dry-struct to handle sinatra params from forms or sidekiq job arguments. Do people use the dry-* libraries directly, or do they use one of the other plugin libraries such as sinatra-validation, sinatra-dry_params, or sidekiq-dry?
https://github.com/IzumiSy/sinatra-validation
https://github.com/tiev/sinatra-dry_param
https://github.com/zorbash/sidekiq-dry
#dryrb #sinatra #sidekiq #params
#dryrb #sinatra #sidekiq #params
should dry-schema or dry-validation rules be defined as named classes, or inline in the sinatra routes using sinatra-validation?
https://github.com/IzumiSy/sinatra-validation#usage
#dryrb #sinatra
Huge progress on dry-logger today. Took a bit longer than I anticipated and I was actually close to give up, but somehow I managed to pull this off. The next, and final, step is re-introduction of colorful output for rack request logging and 1.0.0 will be ready.
#dryrb #hanami #logging #opensource #gem
@konnorrogers yeah, I really hope the Rails team takes notice and start integrating some #dryrb gems. Almost all Rails apps already have them because of some other gem dependency nowadays.
A year (+½) with Hanami in production