devision 0.0.2.3 → 0.0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/devision/models/confirmable.rb +1 -1
- data/lib/devision/models/recoverable.rb +1 -10
- data/lib/devision/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: ef1e47b8a64d2a3f0a71dcd8aaadb46af7c5abf7
|
4
|
+
data.tar.gz: a977483f3f0b9214fb176bc73eb879f68a23c9bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dbc3bd762a5b07d838b57485f022569f88fcc8171bbd7dd5db621bc4ce2c1abb966d96b24262b90d96889ef5969d16815cdec66299b60c162065517c72542fb
|
7
|
+
data.tar.gz: c8970861b0bf34201a77b0a6176666185c06d8db79bd6377e78a422fb47fb56d1cf7aa8e66651fa39a53f687d956fe9dbd36860fbfa7433eb94d9b4e17370407
|
@@ -71,7 +71,7 @@ module Devision
|
|
71
71
|
original_token = raw_confirmation_token
|
72
72
|
saved_token = Devision.token_generator.digest(self, :confirmation_token, original_token)
|
73
73
|
|
74
|
-
confirmable =
|
74
|
+
confirmable = find_or_initialize_with_error_by(confirmation_token: saved_token)
|
75
75
|
confirmable.confirm! if confirmable.persisted?
|
76
76
|
confirmable.confirmation_token = original_token
|
77
77
|
confirmable
|
@@ -97,15 +97,6 @@ module Devision
|
|
97
97
|
end
|
98
98
|
|
99
99
|
module ClassMethods
|
100
|
-
# Attempt to find a user by its email. If a record is found, send new
|
101
|
-
# password instructions to it. If user is not found, returns a new user
|
102
|
-
# with an email not found error.
|
103
|
-
# Attributes must contain the user's email
|
104
|
-
def send_reset_password_instructions(attributes={})
|
105
|
-
recoverable = find_or_initialize_with_errors(reset_password_keys, attributes, :not_found)
|
106
|
-
recoverable.send_reset_password_instructions if recoverable.persisted?
|
107
|
-
recoverable
|
108
|
-
end
|
109
100
|
|
110
101
|
# Attempt to find a user by its reset_password_token to reset its
|
111
102
|
# password. If a user is found and token is still valid, reset its password and automatically
|
@@ -116,7 +107,7 @@ module Devision
|
|
116
107
|
original_token = attributes[:reset_password_token]
|
117
108
|
reset_password_token = Devision.token_generator.digest(self, :reset_password_token, original_token)
|
118
109
|
|
119
|
-
recoverable =
|
110
|
+
recoverable = find_or_initialize_with_error_by(:reset_password_token, reset_password_token)
|
120
111
|
|
121
112
|
if recoverable.persisted?
|
122
113
|
if recoverable.reset_password_period_valid?
|
data/lib/devision/version.rb
CHANGED