identity_cache 1.5.5 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43aca383629f04c700149023fc492f57bd999c1a6ff46b48284d63860921bd19
4
- data.tar.gz: 4c83589f1f2ce435af22b232178983183bb70c3ec0bd4d02e52b955267e4f9c5
3
+ metadata.gz: ffba8f1b3669ad74b16896e59c3b4f669d5802f96ce2fad7ead33ac06b16880c
4
+ data.tar.gz: 74edc98197bd0671dd39ac6446553b23998c1c3a67a122ba916e2542ea7bfcdb
5
5
  SHA512:
6
- metadata.gz: a408644ef8964d9858fa67186f683310189323255e07a11af0b6d98719ca6ebd0743197c6a913b7545103c86630aba3bacbed993cd1d34e54488953206da4173
7
- data.tar.gz: 1dd4579508796c4891f86d4f2f088a4c59ac02bbcf9b0d79a8363c57f71e327e5a4962b232b300c6713101e035efbcbb93d5b0d426f96ad54b05735a36cf4a37
6
+ metadata.gz: c09f6b0e32127203cde69cff41bae906577781d43222115fe34b8632a886d4bec78f7878928e20128f63cd3c39445a8b447ef7ee224a47e8f9b65982e01be339
7
+ data.tar.gz: 7a4bb522ed8674102bcbaf35cb853f2f2816f501e0349c52154214519559f03a5dc876c1ba318296f17c9dece94153e37157cac9afbeaecebb6bbf7a1a4eecbc
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- *.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
data/.rubocop.yml CHANGED
@@ -2,7 +2,6 @@ inherit_gem:
2
2
  rubocop-shopify: rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.5
6
5
  NewCops: disable
7
6
 
8
7
  Layout/BeginEndAlignment:
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.5.6
6
+
7
+ - Minor performance improvements on association read
8
+
9
+ ## 1.5.5
10
+
11
+ - Minor performance improvements on association read
12
+
13
+
5
14
  ## 1.5.4
6
15
 
7
16
  - Make `prefetch_associations` work as expected on associations that have been partially prefetched
data/Gemfile CHANGED
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
  gemspec
5
5
 
6
- gem "rubocop", "~> 1.5"
6
+ gem "rubocop", "~> 1.61.0"
7
7
 
8
8
  gem "rubocop-shopify", "~> 2.9.0", require: false
9
9
 
data/Gemfile.lock ADDED
@@ -0,0 +1,107 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ identity_cache (1.5.6)
5
+ activerecord (>= 7.0)
6
+ ar_transaction_changes (~> 1.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activemodel (7.1.3.2)
12
+ activesupport (= 7.1.3.2)
13
+ activerecord (7.1.3.2)
14
+ activemodel (= 7.1.3.2)
15
+ activesupport (= 7.1.3.2)
16
+ timeout (>= 0.4.0)
17
+ activesupport (7.1.3.2)
18
+ base64
19
+ bigdecimal
20
+ concurrent-ruby (~> 1.0, >= 1.0.2)
21
+ connection_pool (>= 2.2.5)
22
+ drb
23
+ i18n (>= 1.6, < 2)
24
+ minitest (>= 5.1)
25
+ mutex_m
26
+ tzinfo (~> 2.0)
27
+ ar_transaction_changes (1.1.9)
28
+ activerecord (>= 5.2.0)
29
+ ast (2.4.2)
30
+ base64 (0.2.0)
31
+ bigdecimal (3.1.6)
32
+ byebug (11.1.3)
33
+ cityhash (0.6.0)
34
+ concurrent-ruby (1.2.3)
35
+ connection_pool (2.4.1)
36
+ dalli (2.7.11)
37
+ drb (2.2.1)
38
+ i18n (1.14.4)
39
+ concurrent-ruby (~> 1.0)
40
+ json (2.7.1)
41
+ language_server-protocol (3.17.0.3)
42
+ memcached (1.8.0)
43
+ memcached_store (2.3.4)
44
+ activesupport (>= 6)
45
+ memcached (~> 1.8)
46
+ minitest (5.22.2)
47
+ mocha (2.1.0)
48
+ ruby2_keywords (>= 0.0.5)
49
+ mutex_m (0.2.0)
50
+ mysql2 (0.5.6)
51
+ parallel (1.24.0)
52
+ parser (3.3.0.5)
53
+ ast (~> 2.4.1)
54
+ racc
55
+ pg (1.5.6)
56
+ racc (1.7.3)
57
+ rainbow (3.1.1)
58
+ rake (13.1.0)
59
+ regexp_parser (2.9.0)
60
+ rexml (3.2.6)
61
+ rubocop (1.61.0)
62
+ json (~> 2.3)
63
+ language_server-protocol (>= 3.17.0)
64
+ parallel (~> 1.10)
65
+ parser (>= 3.3.0.2)
66
+ rainbow (>= 2.2.2, < 4.0)
67
+ regexp_parser (>= 1.8, < 3.0)
68
+ rexml (>= 3.2.5, < 4.0)
69
+ rubocop-ast (>= 1.30.0, < 2.0)
70
+ ruby-progressbar (~> 1.7)
71
+ unicode-display_width (>= 2.4.0, < 3.0)
72
+ rubocop-ast (1.31.2)
73
+ parser (>= 3.3.0.4)
74
+ rubocop-shopify (2.9.0)
75
+ rubocop (~> 1.33)
76
+ ruby-progressbar (1.13.0)
77
+ ruby2_keywords (0.0.5)
78
+ spy (1.0.5)
79
+ stackprof (0.2.26)
80
+ timeout (0.4.1)
81
+ tzinfo (2.0.6)
82
+ concurrent-ruby (~> 1.0)
83
+ unicode-display_width (2.5.0)
84
+
85
+ PLATFORMS
86
+ arm64-darwin-22
87
+ x86_64-linux
88
+
89
+ DEPENDENCIES
90
+ byebug
91
+ cityhash (~> 0.6.0)
92
+ dalli (~> 2.7.11)
93
+ identity_cache!
94
+ memcached (~> 1.8.0)
95
+ memcached_store (~> 2.3.2)
96
+ minitest (~> 5.14)
97
+ mocha (~> 2.0)
98
+ mysql2 (~> 0.5.3)
99
+ pg (>= 0.18, < 2.0)
100
+ rake (~> 13.0)
101
+ rubocop (~> 1.61.0)
102
+ rubocop-shopify (~> 2.9.0)
103
+ spy (~> 1.0)
104
+ stackprof
105
+
106
+ BUNDLED WITH
107
+ 2.4.22
data/dev.yml CHANGED
@@ -5,7 +5,7 @@ up:
5
5
  - mysql-client@5.7:
6
6
  or: [mysql@5.7]
7
7
  conflicts: [mysql-connector-c, mysql, mysql-client]
8
- - ruby: 3.2.2
8
+ - ruby
9
9
  - isogun
10
10
  - bundler
11
11
 
@@ -9,7 +9,7 @@ module IdentityCache
9
9
  reflection.active_record.class_eval(<<-RUBY, __FILE__, __LINE__ + 1)
10
10
  def #{cached_accessor_name}
11
11
  association_klass = association(:#{name}).klass
12
- if (loaded_by_idc? || association_klass.should_use_cache?) && #{reflection.foreign_key}.present? && !association(:#{name}).loaded?
12
+ if #{reflection.foreign_key}.present? && !association(:#{name}).loaded? && (loaded_by_idc? || association_klass.should_use_cache?)
13
13
  if defined?(#{records_variable_name})
14
14
  #{records_variable_name}
15
15
  else
@@ -25,7 +25,7 @@ module IdentityCache
25
25
  def read(record)
26
26
  assoc = record.association(name)
27
27
 
28
- if (record.send(:loaded_by_idc?) || assoc.klass.should_use_cache?) && !assoc.loaded? && assoc.target.blank?
28
+ if !assoc.loaded? && assoc.target.blank? && (record.send(:loaded_by_idc?) || assoc.klass.should_use_cache?)
29
29
  if record.instance_variable_defined?(records_variable_name)
30
30
  record.instance_variable_get(records_variable_name)
31
31
  elsif record.instance_variable_defined?(dehydrated_variable_name)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IdentityCache
4
- VERSION = "1.5.5"
4
+ VERSION = "1.5.6"
5
5
  CACHE_VERSION = 8
6
6
  end
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.5
4
+ version: 1.5.6
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-02-27 00:00:00.000000000 Z
17
+ date: 2024-03-19 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -111,12 +111,14 @@ files:
111
111
  - ".github/workflows/cla.yml"
112
112
  - ".gitignore"
113
113
  - ".rubocop.yml"
114
+ - ".ruby-version"
114
115
  - ".spin/bootstrap"
115
116
  - ".spin/svc.yml"
116
117
  - CAVEATS.md
117
118
  - CHANGELOG.md
118
119
  - CONTRIBUTING.md
119
120
  - Gemfile
121
+ - Gemfile.lock
120
122
  - LICENSE
121
123
  - README.md
122
124
  - Rakefile