cakephp/cakephp — pull request #410 by scottharwell (2012-01-16 03:14:31+00:00)
Title: Form model validation

Per ticket #2169, I developed logic in the form helper to use the `on` key as part of the validation. The logic requires that the model structure be passed to the _isRequiredField function. When the function loops through validateProperties, the new logic looks for the `on` key. If it is set, and the model structure is passed, then it checks to see if the current request has an id. It uses the `on` key and the request model id to determine if the rule is valid or not.

In my testing, this worked. I cannot think of a circumstance where the action would be update and there would be no primary key in the request data. Conversely, if there is no primary key in the request data, then the action would always be create, correct? So, I think that this should cover all situations.