identity_cache 1.5.3 → 1.5.5
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/identity_cache/belongs_to_caching.rb +1 -1
- data/lib/identity_cache/cached/belongs_to.rb +13 -9
- data/lib/identity_cache/configuration_dsl.rb +1 -1
- data/lib/identity_cache/version.rb +1 -1
- data/lib/identity_cache/with_primary_index.rb +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43aca383629f04c700149023fc492f57bd999c1a6ff46b48284d63860921bd19
|
4
|
+
data.tar.gz: 4c83589f1f2ce435af22b232178983183bb70c3ec0bd4d02e52b955267e4f9c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a408644ef8964d9858fa67186f683310189323255e07a11af0b6d98719ca6ebd0743197c6a913b7545103c86630aba3bacbed993cd1d34e54488953206da4173
|
7
|
+
data.tar.gz: 1dd4579508796c4891f86d4f2f088a4c59ac02bbcf9b0d79a8363c57f71e327e5a4962b232b300c6713101e035efbcbb93d5b0d426f96ad54b05735a36cf4a37
|
data/CHANGELOG.md
CHANGED
@@ -14,7 +14,7 @@ module IdentityCache
|
|
14
14
|
ensure_base_model
|
15
15
|
|
16
16
|
unless (reflection = reflect_on_association(association))
|
17
|
-
raise AssociationError, "Association named '#{association}' was not found on #{self
|
17
|
+
raise AssociationError, "Association named '#{association}' was not found on #{self}"
|
18
18
|
end
|
19
19
|
|
20
20
|
if reflection.scope
|
@@ -77,16 +77,20 @@ module IdentityCache
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
80
|
+
if ids_to_owner_record.any?
|
81
|
+
load_strategy.load_multi(
|
82
|
+
reflection.klass.cached_primary_index,
|
83
|
+
ids_to_owner_record.keys
|
84
|
+
) do |associated_records_by_id|
|
85
|
+
associated_records_by_id.each do |id, associated_record|
|
86
|
+
owner_record = ids_to_owner_record.fetch(id)
|
87
|
+
write(owner_record, associated_record)
|
88
|
+
end
|
88
89
|
|
89
|
-
|
90
|
+
yield associated_records_by_id.values.compact
|
91
|
+
end
|
92
|
+
else
|
93
|
+
yield records.filter_map { |record| record.instance_variable_get(records_variable_name) }
|
90
94
|
end
|
91
95
|
end
|
92
96
|
end
|
@@ -143,7 +143,7 @@ module IdentityCache
|
|
143
143
|
|
144
144
|
def check_association_for_caching(association)
|
145
145
|
unless (association_reflection = reflect_on_association(association))
|
146
|
-
raise AssociationError, "Association named '#{association}' was not found on #{self
|
146
|
+
raise AssociationError, "Association named '#{association}' was not found on #{self}"
|
147
147
|
end
|
148
148
|
if association_reflection.options[:through]
|
149
149
|
raise UnsupportedAssociationError, "caching through associations isn't supported"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: identity_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camilo Lopez
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2024-
|
17
|
+
date: 2024-02-27 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activerecord
|
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
190
190
|
- !ruby/object:Gem::Version
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
|
-
rubygems_version: 3.5.
|
193
|
+
rubygems_version: 3.5.6
|
194
194
|
signing_key:
|
195
195
|
specification_version: 4
|
196
196
|
summary: IdentityCache lets you specify how you want to cache your model objects,
|