authlogic_email_token 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/authlogic/acts_as_authentic/email_token/confirmation.rb +17 -10
- 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: bb33cecc1c682954290b9ccf4836524b2aee33ce
|
4
|
+
data.tar.gz: 62e3ec5fd7424e656c5218b291b92837096217e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9931e2c5c2422619df7119d9feacc546a1cc597bafcd9b4f1350315d8c418c161a3f69745c2599472f1367d839f51acae03cf3282b54fccc1c721a46fecd3aa4
|
7
|
+
data.tar.gz: 071c2f34c38e9107bd3a8c230df518317db564e0d9ef3599f62aa0f84caf88bffab2ccadbdfddae47ee934f12d0c7cec26d6cfc4d7f49bbffde24f6b7c43b309
|
@@ -42,7 +42,7 @@ module Authlogic::ActsAsAuthentic::EmailToken::Confirmation
|
|
42
42
|
send(self.class.activation_method) if respond_to?(self.class.activation_method)
|
43
43
|
if read_attribute(:new_email).present?
|
44
44
|
self.email = new_email
|
45
|
-
|
45
|
+
write_attribute :new_email, nil
|
46
46
|
end
|
47
47
|
reset_email_token
|
48
48
|
end
|
@@ -115,15 +115,14 @@ module Authlogic::ActsAsAuthentic::EmailToken::Confirmation
|
|
115
115
|
# end
|
116
116
|
#
|
117
117
|
# private
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
#
|
118
|
+
#
|
119
|
+
# def existing_user_params
|
120
|
+
# params.require(:user).permit(:new_email, :password, :password_confirmation)
|
121
|
+
# end
|
122
|
+
#
|
123
|
+
# def new_user_params
|
124
|
+
# params.require(:user).permit(:email, :password, :password_confirmation)
|
125
|
+
# end
|
127
126
|
# end
|
128
127
|
def maybe_deliver_email_confirmation!(controller)
|
129
128
|
if email_changed_previously?
|
@@ -154,4 +153,12 @@ module Authlogic::ActsAsAuthentic::EmailToken::Confirmation
|
|
154
153
|
end
|
155
154
|
# Rails' text_field helper calls new_email_before_typecast.
|
156
155
|
alias_method :new_email_before_type_cast, :new_email
|
156
|
+
|
157
|
+
# Like a normal attribute setter, except it is a no-op if the value is equal to the
|
158
|
+
# current value of #email.
|
159
|
+
def new_email=(e)
|
160
|
+
if e.present? and e != email
|
161
|
+
write_attribute :new_email, e
|
162
|
+
end
|
163
|
+
end
|
157
164
|
end
|