Skip to content

Conversation

@robinaugh
Copy link

Changes proposed in this pull request

This addresses the use case I referred to in #137 (comment), which is that when validateConfirmation's resulting function receives an ember-data object as its content, and the original field (say password) is unchanged from that ember-data object, the validating field (say passwordConfirmation) is considered invalid, no matter whether it matches the current content or not.

It looks like @brandynbennett took a stab at addressing this issue with #138 (later merged as #219 by @snewcomer), but that only works with POJOs whose top-level keys include the attributes we're targeting, which for ember-data objects are quite nested.

There may be a better way to grab all of an ember-data object's attributes than what I've got here, which admittedly uses their private API so I'm not thrilled about that, but it does get the job done. Open to suggestions if there's a better approach folks think we should take, or if the fact that we're seeing ember-data objects instead of POROS in a validator means we're just "doing it wrong" somewhere else in my team's code. 😄

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants