by sandstrom · 13y ago · 0 comments
- How can this be used in tandem with strong_parameters; should ensuring the structure of params be a responsibility of the controller or the mutation (I'm leaning towards the former)? [1]
- How can validation duplication between models and mutations be avoided? In the example 'string :email, matches: EMAIL_REGEX' was used, but presumably one will still validate the email in the model. I'm guessing there are solutions to this, perhaps the existing model validation can somehow be used?
The duplicate of validations between models and mutations is interesting. Currently at UV, we have some duplication -- however, in other cases we're relying entirely on the validations of the Mutation. I do think it's possible to rely entirely on validation from mutations -- I need to get some more real-world experience with this to know how well it will work out :)
User.email.validation
Similar to that query project.. Can't remember the name now :-)