Skip to content
New issue

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

Validating nested entities #7

Open
gxxcastillo opened this issue Feb 27, 2013 · 1 comment
Open

Validating nested entities #7

gxxcastillo opened this issue Feb 27, 2013 · 1 comment
Labels

Comments

@gxxcastillo
Copy link
Contributor

How would we want to validate nested entities?

On .set():
This ones easy, just use the given validation method.

On .save():
This ones seems a bit trickier since we are saving the parent entity and don't have a direct reference to which sub-entity action to use. Would it be overly hacky to do something like

fields: [
   { "name": "address", "type": "entity", "action": "edit"}
]

Where address is a nested entity and the "action" is the name of the sub-entities action we want to use for validiting the given sub-entity.

I still haven't confronted this issue so I'm kinda taking a shot in the dark, however, .set() and .save() should be common use-cases.

@gxxcastillo
Copy link
Contributor Author

So far, I've moved forward with the option to specify nested validation via an "entity" type on when saving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant