dimagi/Vellum — pull request #130 by mwhite (2013-10-23 21:09:50+00:00)
Title: fix validation condition getting lost

The main change here is

- if (this.__spec[attr] && this.__spec[attr].presence !== "notallowed") {
+
+ if (this.__spec[attr] && attr.indexOf('_') !== 0) {

Since all nodes initially get created as DataBindOnly mugs, because the
data tree (and then bind list) are parsed before the control block (and
then things get copied over to a new instance of the final control
node's question type), and proper Hidden Values have constraintAttr and
requiredAttr as "notallowed", this was preventing them from getting set.

It's ok to only reference notallowed on the side that displays validation
errors to the user.

This also changes some things to make setting and copying MugElement
attrs safer/more consistent.