You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
optional do
array :tags, class: String
hash :prefs do
boolean :smoking
boolean :view
end
end
I'd like to use custom validation on :smoking
I'm doing this in the validate method
How to add an error on key ":prefs -> :smoking" ?
Is it possible with add_error ?
The text was updated successfully, but these errors were encountered:
Unfortunately, it doesn't work correctly: the last key isn't converted to a symbol, so the error is added as [:colors]["foreground"] instead of [:colors][:foreground].
Both #121 and #132 would make it work as expected, but I'm not happy merging either of them because they would break backwards compatibility. I think the right way to fix this problem is with a deprecation cycle.
could it be possible to have a similar way of doing it for arrays ?
like add_error("colors[3].foreground", :not_a_color) for adding error to the forth hash inside array colors
lets use this example :
I'd like to use custom validation on :smoking
I'm doing this in the
validate
methodHow to add an error on key ":prefs -> :smoking" ?
Is it possible with
add_error
?The text was updated successfully, but these errors were encountered: