aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/CHANGELOG.md
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-03-04 18:56:05 +0100
committerYves Senn <yves.senn@gmail.com>2013-03-04 18:56:05 +0100
commit8c1687bbf8dd518d64fc7180b33c1cb57f29a69a (patch)
tree17538b7a80d65742b6872f7b1fef5122c324060b /activemodel/CHANGELOG.md
parentb501ee47fa3f877f8b8028e732f8ef8a22cc75fb (diff)
downloadrails-8c1687bbf8dd518d64fc7180b33c1cb57f29a69a.tar.gz
rails-8c1687bbf8dd518d64fc7180b33c1cb57f29a69a.tar.bz2
rails-8c1687bbf8dd518d64fc7180b33c1cb57f29a69a.zip
`has_secure_password` is not invalid when assigning empty Strings.
Closes #9535. With 692b3b6 the `password=` setter does no longer set blank passwords. This triggered validation errors when assigning empty Strings to `password` and `password_confirmation`. This patch only sets the confirmation if it is not `blank?`.
Diffstat (limited to 'activemodel/CHANGELOG.md')
-rw-r--r--activemodel/CHANGELOG.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md
index e518334d5d..8c54ec3d45 100644
--- a/activemodel/CHANGELOG.md
+++ b/activemodel/CHANGELOG.md
@@ -1,5 +1,15 @@
## Rails 4.0.0 (unreleased) ##
+* `has_secure_password` does not fail the confirmation validation
+ when assigning empty String to `password` and `password_confirmation`.
+
+ Example:
+
+ # given User has_secure_password.
+ @user.password = ""
+ @user.password_confirmation = ""
+ @user.valid?(:update) # used to be false
+
* `validates_confirmation_of` does not override writer methods for
the confirmation attribute if no reader is defined.