Quantcast
Channel: Calling a macro on a depply nested rule
Browsing all 10 articles
Browse latest View live

Calling a macro on a depply nested rule

@DawidJanczak wrote: Hello, I was wondering if it’s possible to apply a macro to each element of an array that is itself nested in an array. Consider the following structure...

View Article



Calling a macro on a depply nested rule

@solnic wrote: Can you provide an executable script/test that shows what you want to achieve? Read full topic

View Article

Calling a macro on a depply nested rule

@DawidJanczak wrote: Of course, I was thinking something like this: https://github.com/dry-rb/dry-validation/compare/master...DawidJanczak:macro-on-deeply-nested-rule (extending previous example in...

View Article

Calling a macro on a depply nested rule

@DawidJanczak wrote: @solnic does the above spec work for you? Read full topic

View Article

Calling a macro on a depply nested rule

@DawidJanczak wrote: Just in case someone else is running into this the way we ended up handling this is by replacing macros with methods accepting key and value and invoking those methods manually...

View Article


Calling a macro on a depply nested rule

@solnic wrote: Yeah I get it now. We’re missing support for specifying such paths. addresses.phones does not denote that addresses is an array with elements that have phones key. This will be...

View Article

Image may be NSFW.
Clik here to view.

Calling a macro on a depply nested rule

@DawidJanczak wrote: Thank you @solnic, I opened an issue here https://github.com/dry-rb/dry-validation/issues/578 Read full topic

View Article

Calling a macro on a depply nested rule

@Pigius wrote: Any progress in here? I saw on that forum, that part of the solution is to use register_macro(:name_of_macro) do key([*path, :attribute]).failure("does not seem to be possible") unless...

View Article


Calling a macro on a depply nested rule

@pabloh wrote: If you don’t mind, can you show the gist of your implementation? Thanks in adavance. Read full topic

View Article


Calling a macro on a depply nested rule

@DawidJanczak wrote: Sure, it’s something like this: rule(:outer_array).each do value[:nested_array].each_with_index do |nested_elem, nested_elem_index| nested_key = key(key.path.keys +...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images