active_model-password 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_model/password.rb +3 -1
- data/lib/active_model/password/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5106d672b63e8fcec708ef82530e775402d491b9
|
4
|
+
data.tar.gz: 054601944e276ab4acc78dba8cf04f97490cc6e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f22234ea3b10a20ce035c29f512a3820ab1a4a974b935f806cd28025a868c020371d2f6444da1191f077054409f3ba2bd755dfa33210670ff97c31592c595de
|
7
|
+
data.tar.gz: b85db3bbb5ef7c3b935ea54916df6be1ae9447c8c92a33031a42a4157f770cafe55307dbe2ae5a0aed0e0c6aa62ffa1bf3bedeb95b52d04652eef781f7c92a76
|
@@ -30,7 +30,9 @@ module ActiveModel
|
|
30
30
|
def user_password
|
31
31
|
old_password = user.password
|
32
32
|
user.password = password
|
33
|
-
|
33
|
+
if user.invalid? and user.errors[:password].present?
|
34
|
+
user.errors[:password].each { |error| errors.add(:password, error) }
|
35
|
+
end
|
34
36
|
ensure
|
35
37
|
user.password = old_password
|
36
38
|
end
|