store_attribute 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/store_attribute/active_record/store.rb +4 -3
- data/lib/store_attribute/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: adaa8107d5917cf34ec29623a75a16fd14b7c5231ee57c7b6c0d3fdac1632b42
|
4
|
+
data.tar.gz: 8b7a96bc6da2779a1c7812d453374b312a52c77068511796c0199617f875d2e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fb0f5ae8ac985d43c909df92930e8a60dcf8910d967a563b23524021ab8acc014fa6e83cbcca6687855c2372c48450a65b5ebb801475f1dd0a7100a9a7a8a6c
|
7
|
+
data.tar.gz: 54703853d6172fd22bd54bec3460045dd298aeb12984bd6763b45a8a48943f6ff20329cef4b744bfd36732bb5e1a3ff0bac97f82fb15cf06b170b1592025d577
|
data/CHANGELOG.md
CHANGED
@@ -186,12 +186,11 @@ module ActiveRecord
|
|
186
186
|
def _define_dirty_tracking_methods(store_attribute, keys, prefix: nil, suffix: nil)
|
187
187
|
_store_accessors_module.module_eval do
|
188
188
|
define_method("changes") do
|
189
|
-
return @changes if defined?(@changes)
|
190
189
|
changes = super()
|
191
190
|
self.class.local_stored_attributes.each do |accessor, attributes|
|
192
191
|
next unless attribute_changed?(accessor)
|
193
192
|
|
194
|
-
prev_store, new_store = changes[accessor]
|
193
|
+
prev_store, new_store = changes[accessor].map(&:dup)
|
195
194
|
|
196
195
|
prev_store&.each do |key, value|
|
197
196
|
if new_store[key] == value
|
@@ -199,8 +198,10 @@ module ActiveRecord
|
|
199
198
|
new_store&.except!(key)
|
200
199
|
end
|
201
200
|
end
|
201
|
+
|
202
|
+
changes[accessor] = prev_store, new_store
|
202
203
|
end
|
203
|
-
|
204
|
+
changes
|
204
205
|
end
|
205
206
|
|
206
207
|
keys.flatten.each do |key|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: store_attribute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|