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: c0869b2f98d02a23adb72e8b4bd858808b762192ebbb953c84807d8f462aa2da
4
- data.tar.gz: 9ed06a0ca435e62a9ed2f66cb8b8164fa89d26688128cfed4b8f83ee0899e535
3
+ metadata.gz: 8eab77129accc99c77b848b4af35cecff2c31bb46c48e5b9937400720ccdd5f4
4
+ data.tar.gz: f08d79cbf48532b50d8894803442eb5cf955f18348902cf95611ab17a12ef09a
5
5
  SHA512:
6
- metadata.gz: 1fb15f3111386f6ebef1516b61fe397976b29d9f2f87400ff311bfc5331c6a7371bfcc06ff011f3687ba273c856fbaeea5889b32f778360a06c56065b3ce381a
7
- data.tar.gz: 2cfe923acd81309fb2bce64d01d85e9b8bca89ace312aeb3400bbbb7c34a6f05b9f86222706503c801c13780f6e1884325ac928c310695c2fd10e207b23567d9
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}", :boolean
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
- write_attribute password_field, (self.persisted? ? 'CLEAR_EXISTING_PASSWORD_FOR_ROW' : nil)
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 = new_password
87
+ self.password = tmp_new_pwd
87
88
  end
88
89
  end
89
90
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BetterRecord
4
- VERSION = '0.10.4'
4
+ VERSION = '0.10.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: better_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampson Crowley