I've noticed that every time I execute a save or update operation the framework fires all validations, including uniqueness, but the uniqueness validation consider all records that already are on the database including the record which I am updating, so when I update a record and don't change the property with uniqueness validation it will fire a 'already_exists' message.. I thought I could solve it by adding a filter to ignore the record I am editing something like where field = value and id <> this.id where this.id is related to the id of the current record. Unfortunately I couldn't do it by nesting ARWhereStatements, but I think you could. Check this link with my proposal code https://github.com/awleao/iActiveRecord-Uniqueness
Thank you for contribution. I've got your point and it makes sense :+1:
Looks like I've implemented this 'feature'.
3a2410546674c4ab5f15a41df3e4e4e8541f9a45
I've noticed that every time I execute a save or update operation the framework fires all validations, including uniqueness, but the uniqueness validation consider all records that already are on the database including the record which I am updating, so when I update a record and don't change the property with uniqueness validation it will fire a 'already_exists' message.. I thought I could solve it by adding a filter to ignore the record I am editing something like where field = value and id <> this.id where this.id is related to the id of the current record. Unfortunately I couldn't do it by nesting ARWhereStatements, but I think you could. Check this link with my proposal code https://github.com/awleao/iActiveRecord-Uniqueness