has_editable_password 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/has_editable_password.rb +3 -0
- data/lib/version.rb +1 -1
- data/spec/has_editable_password_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWY1Mjc0ZDJhZDQyNzA0ZWMxNDNhMDdkMjgwNDRmODY2ZTU2NmQ3Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Njg3MmE4ZjVhM2RkNmU3ZWQxMjE5OTYxZDU5MjRkMWMyOWJmZDQyNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzBmMWFjNjljY2Y1Y2IzNzU0NDcyYjc0OWY2NTJjNjU3ZjBlOWNkNzczNjM5
|
10
|
+
YzYyZWQxZDQ5NzQ2ZTZmZjg3NDM1M2Y5NzM3MDY2N2EzNDU3YjdhM2M1MTdm
|
11
|
+
ZTNhZmFkYzZiNzk3NWE0MTRiMmQ4OTE0ZDBlNTdkOGQwYThhOTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzUwMjRjOTYzZmRlYzA1NWZlM2Y0OWZmMmM4MDFjZDM5ODA5MWNiMjVmNDE0
|
14
|
+
NTMwMDYwYTAwZjMyYTNlYWFkNjZmZjc3ZTlkYzRiYjkzMmNlMjY3NmZhYmZj
|
15
|
+
NjNmNjYxNTkzNjNlYWYzMjJjMmM5NGVhYzE4Yjk3YmViZjRjODg=
|
@@ -19,6 +19,9 @@ module HasEditablePassword
|
|
19
19
|
|
20
20
|
unless password_digest.blank? or password_digest_changed?
|
21
21
|
self.previous_password_digest = password_digest if respond_to? :previous_password_digest=
|
22
|
+
end
|
23
|
+
|
24
|
+
unless password_digest_changed?
|
22
25
|
self.password_digest_updated = Time.now if respond_to? :password_digest_updated=
|
23
26
|
end
|
24
27
|
|
data/lib/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION = '0.1.
|
1
|
+
VERSION = '0.1.1'
|
@@ -51,6 +51,10 @@ describe HasEditablePassword do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
context 'password_digest_updated= exists' do
|
54
|
+
it 'sets password_digest_updated on create too' do
|
55
|
+
expect(user.password_digest_updated).to_not be_nil
|
56
|
+
end
|
57
|
+
|
54
58
|
it 'sets the password_digest_updated field' do
|
55
59
|
expect(user).to receive(:password_digest_updated=)
|
56
60
|
user.password = 'new_secret'
|