Skip to content

how to add errors in nested objects #140

Description

@MathieuDerelle

lets use this example :

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions