umbrellio-sequel-plugins 0.4.0.145 → 0.4.0.152
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/sequel/plugins/attr_encrypted.rb +11 -4
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c457e432fd30ccbc7eea5a66e94ce828c179dc25e45f403ee8a7cc78d23d8f1
|
4
|
+
data.tar.gz: 3fee2f7af3fedb7ed161964ce6a1bdd4b115b88d8d4faa67bc14f9d0317c74b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '093103fc7ae3108cc818312319d63ef2229073bfa48453a71d764de9f498bc597b09c5148219c12b930a334824ed6ef828c44b4a814470a90739bf41cca3e12e'
|
7
|
+
data.tar.gz: 416ed5d8f41e6d947fc8b82d4752e8caf55dd985f639d8b347b15e3e523fc067c133c14f4d21838c0b3221eb847ba3fe2433907d0349f4b42dfe865545511dee
|
data/README.md
CHANGED
@@ -233,7 +233,6 @@ Order.create(first_name: "Ivan")
|
|
233
233
|
|
234
234
|
order = Order.create(first_name: "Ivan", last_name: "Smith",
|
235
235
|
secret_data: { "some_key" => "Some Value" })
|
236
|
-
order.reload
|
237
236
|
order.first_name # => "Ivan"
|
238
237
|
order.secret_data # => { "some_key" => "Some Value" }
|
239
238
|
```
|
@@ -32,7 +32,6 @@ module Sequel::Plugins::AttrEncrypted
|
|
32
32
|
#
|
33
33
|
# order = Order.create(first_name: "Ivan", last_name: "Smith",
|
34
34
|
# secret_data: { "some_key" => "Some Value" })
|
35
|
-
# order.reload
|
36
35
|
# order.first_name # => "Ivan"
|
37
36
|
# order.last_name # => "Smith"
|
38
37
|
# order.secret_data # => { "some_key" => "Some Value" }
|
@@ -80,12 +79,20 @@ module Sequel::Plugins::AttrEncrypted
|
|
80
79
|
end
|
81
80
|
|
82
81
|
module InstanceMethods
|
83
|
-
def
|
82
|
+
def save(*)
|
83
|
+
super.tap { _reset_encrypted_attrs_ivars }
|
84
|
+
end
|
85
|
+
|
86
|
+
def refresh(*)
|
87
|
+
super.tap { _reset_encrypted_attrs_ivars }
|
88
|
+
end
|
89
|
+
|
90
|
+
private
|
91
|
+
|
92
|
+
def _reset_encrypted_attrs_ivars
|
84
93
|
self.class.instance_variable_get(:@_encrypted_attributes)&.each do |attr|
|
85
94
|
instance_variable_set("@#{attr}", nil)
|
86
95
|
end
|
87
|
-
|
88
|
-
super
|
89
96
|
end
|
90
97
|
end
|
91
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umbrellio-sequel-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.0.
|
4
|
+
version: 0.4.0.152
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nulldef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|
@@ -226,8 +226,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
226
226
|
- !ruby/object:Gem::Version
|
227
227
|
version: '0'
|
228
228
|
requirements: []
|
229
|
-
|
230
|
-
rubygems_version: 2.7.7
|
229
|
+
rubygems_version: 3.0.8
|
231
230
|
signing_key:
|
232
231
|
specification_version: 4
|
233
232
|
summary: Sequel plugins
|