Update Contributor and Development Docs for new validations
A recent production incident exposed that it is easy to miss the impact of adding validations.
For example, we added a validation on the users website_url
to ensure this value is a valid URL containing https://
or http://
, but there was no mechanism in place to identify existing records which would then become invalid - and it was not caught during development or code review by the maintainer.
This is a corrective action to update our documentation guidelines - when adding a new validation for an existing model, we need to be clear that this can break existing records (!69436 (comment 669193653)) and provide best practices, such as using if: :attribute_changed?
for validations.