We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Im nesting mutations like so :
class ParentMutation < Mutations::Command required do hash :a do model :b, class: Hash end end def validate validation_outcome = ChildMutation.validate(a[:b]) return if validation_outcome.success? merge_errors(validation_outcome.errors) end def execute # ... some code ChildMutation.run!(a[:b]) # ... some code end end class ChildMutation < Mutations::Command required do string :c end end
(its an extremely simplified version)
when running ParentMutation.run(a: { b: {} }).errors, im getting errors as follow
ParentMutation.run(a: { b: {} }).errors
{ :c => #<Mutations::ErrorAtom:0x00007fd5a4540ca0 @key=:c, @symbol=:required, @message=nil, @index=nil> }
but I'd like to prefix the errors with a.b during merge_errors to get something like this instead
a.b
merge_errors
{ 'a.b.c' => #<Mutations::ErrorAtom:0x00007fd5a4540ca0 @key=:c, @symbol=:required, @message=nil, @index=nil> }
or
{ :a => { :b => { :c => #<Mutations::ErrorAtom:0x00007fd5a4540ca0 @key=:c, @symbol=:required, @message=nil, @index=nil> } } }
Is it possible ?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Im nesting mutations like so :
(its an extremely simplified version)
when running
ParentMutation.run(a: { b: {} }).errors
, im getting errors as followbut I'd like to prefix the errors with
a.b
duringmerge_errors
to get something like this insteador
Is it possible ?
The text was updated successfully, but these errors were encountered: