diff options
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/CHANGELOG.md | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index 9aee47bd52..a1f3d081db 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -3,6 +3,8 @@ * Add `ActiveModel::Errors#full_messages_for`, to return all the error messages for a given attribute. + Example: + class Person include ActiveModel::Validations @@ -19,26 +21,27 @@ * Added a method so that validations can be easily cleared on a model. For example: - class Person - include ActiveModel::Validations + class Person + include ActiveModel::Validations - validates_uniqueness_of :first_name - validate :cannot_be_robot + validates_uniqueness_of :first_name + validate :cannot_be_robot - def cannot_be_robot - errors.add(:base, 'A person cannot be a robot') if person_is_robot + def cannot_be_robot + errors.add(:base, 'A person cannot be a robot') if person_is_robot + end end - end Now, if someone runs `Person.clear_validators!`, then the following occurs: - Person.validators # => [] - Person._validate_callbacks.empty? # => true + Person.validators # => [] + Person._validate_callbacks.empty? # => true *John Wang* * `has_secure_password` does not fail the confirmation validation when assigning empty String to `password` and `password_confirmation`. + Fixes #9535. Example: |