better_record 0.10.4 → 0.10.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eab77129accc99c77b848b4af35cecff2c31bb46c48e5b9937400720ccdd5f4
|
4
|
+
data.tar.gz: f08d79cbf48532b50d8894803442eb5cf955f18348902cf95611ab17a12ef09a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18e53989941cccfcdb35496fab632e3763fc70c125fdd20538efcb30231e9e11a1f4990868c089b9b1df4fa98f0a8385845282d3bc2281188235e1b1003cb16f
|
7
|
+
data.tar.gz: cc0759c9e0bd35c45bdcc5513bb0c0079bcf7626232d58f8fb4b09270593875197befd5a3b48ec9d1eb493adc47e529ee0a2e750eddd2f2f1248005ced3a0043
|
@@ -27,12 +27,13 @@ module BetterRecord
|
|
27
27
|
#{password_field}
|
28
28
|
new_#{password_field}
|
29
29
|
new_#{password_field}_confirmation
|
30
|
+
clear_#{password_field}
|
30
31
|
]
|
31
32
|
|
32
33
|
# == Attributes ===========================================================
|
33
34
|
attribute :"new_#{password_field}", :text
|
34
35
|
attribute :"new_#{password_field}_confirmation", :text
|
35
|
-
attribute :"clear_#{password_field}", :
|
36
|
+
attribute :"clear_#{password_field}", :text
|
36
37
|
|
37
38
|
# == Extensions ===========================================================
|
38
39
|
|
@@ -68,9 +69,9 @@ module BetterRecord
|
|
68
69
|
|
69
70
|
define_method :"clear_#{password_field}=" do |value|
|
70
71
|
if value && (value.to_sym == :clear)
|
71
|
-
|
72
|
-
__send__ :"new_#{password_field}", nil
|
73
|
-
__send__ :"new_#{password_field}_confirmation", nil
|
72
|
+
__send__ :"#{password_field}=", (self.persisted? ? 'CLEAR_EXISTING_PASSWORD_FOR_ROW' : nil)
|
73
|
+
__send__ :"new_#{password_field}=", nil
|
74
|
+
__send__ :"new_#{password_field}_confirmation=", nil
|
74
75
|
end
|
75
76
|
true
|
76
77
|
end
|
@@ -83,7 +84,7 @@ module BetterRecord
|
|
83
84
|
if tmp_new_pwd != tmp_new_confirmation
|
84
85
|
errors.add(:"new_#{password_field}", 'Password does not match confirmation')
|
85
86
|
else
|
86
|
-
self.password =
|
87
|
+
self.password = tmp_new_pwd
|
87
88
|
end
|
88
89
|
end
|
89
90
|
end
|