Currently, having a Form with an attribute with the same name of the mimicked model does not work well. In some cases, the value of the attribute is overwritten with the mimicked model data, resulting in invalid data.
With these changes, data from the mimicked model will override the params_hash hash values and the behavior will be the right one.
The only unsupported scenario is when the attribute contains a hash value, as it would be very difficult for the code to determine if the hash is the mimicked model information or the value for the attribute.
Currently, having a Form with an attribute with the same name of the mimicked model does not work well. In some cases, the value of the attribute is overwritten with the mimicked model data, resulting in invalid data.
With these changes, data from the mimicked model will override the
params_hash
hash values and the behavior will be the right one.The only unsupported scenario is when the attribute contains a hash value, as it would be very difficult for the code to determine if the hash is the mimicked model information or the value for the attribute.
I modified tests to check this situation.