Open xspager opened 8 years ago
It was like that before! The problem is that plain tables will not loop in a specific order. So the validations of the attributions were running in different orders every time. I changed to nested tables so it goes in the same order as they are declared.
You could also sort keys before validating. This is typically implemented using utility iterator "sorted_pairs". It won't be the declaration order but it will be deterministic.
I do not feel a need for ordered validations, could not sailor support both?
Like... use ipairs
if model.attributes[1] ~= nil
or #model.attributes >0
, pairs
otherwise.
Can't the model attributes table a plain table? Instead of:
be like: