identity_cache 1.4.0 → 1.5.0

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: 0d167207235c4ac1deec2f1d6f383949b4c74031733c72ab700471b7f5a66407
4
- data.tar.gz: 55e77933d0fbc095d1cad6ba038b2900edecb268504ff2238628828b10de9d39
3
+ metadata.gz: 7d664c4b120abe1a0aa9258143d60856d2da9773ac9ced3635f547de02533105
4
+ data.tar.gz: 21ea5ee371633511dd2f92394ebec26daa986ac847e4c4ab8150489b1062f12b
5
5
  SHA512:
6
- metadata.gz: 270532b8a523b9f14f1d55c6a147d83844b4b4fb0b4b954d696bacc6de0437835dd3244126f136013450160de488e4c834211e86d9a2da8b191042fdaea63d93
7
- data.tar.gz: 3bba5cd0734150975ef4b475c00f1c15d72c3a0d919dc84c6abd6b51ed7c9dc309dcb647d01212d6028f1c37a73a23cbab00daa3521a4aeaccbffcf9a01f3d09
6
+ metadata.gz: 7a1059452a1a21efe5ccaf2f434290bf50dfb9326f99785f442a02b6d0c9c0005fb2019ca952ad65dbe744fda3886556fc0902f066dd4962dbfb924d2237bcfc
7
+ data.tar.gz: ab0a8e434920d83e984052fb91ebd98e65caab07596a144d93159faed56e668a92003d6f7aba5c696404c6ad41b6178fa0d32deb087dd52cc17a8a849959b110
@@ -16,7 +16,7 @@ jobs:
16
16
  matrix:
17
17
  entry:
18
18
  - name: 'Minimum supported'
19
- ruby: '2.7'
19
+ ruby: '3.0'
20
20
  gemfile: "Gemfile.min-supported"
21
21
  - name: 'Latest released & run rubocop'
22
22
  ruby: '3.2'
data/CHANGELOG.md CHANGED
@@ -2,38 +2,57 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.5.0
6
+
7
+ - Require Active Record 7+
8
+ - Require Ruby 3+
9
+ - Improve compatibility with Active Record 7.1.
10
+
11
+ ## 1.4.1
12
+
13
+ ### Fixes
14
+
15
+ - Fix `fetch_multi_by` bug for queries having a single field with distinct values. (#536)
16
+
5
17
  ## 1.4.0
6
18
 
7
19
  ### Features
20
+
8
21
  - Add `fetch_multi_by` support for composite-key indexes. (#534)
9
22
 
10
23
  ## 1.3.1
11
24
 
12
25
  ### Fixes
26
+
13
27
  - Remove N+1 queries from embedded associations when using `fetch` while `should_use_cache` is false. (#531)
14
28
 
15
29
  ## 1.3.0
16
30
 
17
31
  ### Features
32
+
18
33
  - Return meaningful value from `expire_cache` indicating whenever it succeeded or failed in the process. (#523)
19
34
 
20
35
  ### Fixes
36
+
21
37
  - Expire parents cache when when calling `expire_cache`. (#523)
22
38
  - Avoid creating too many shapes on Ruby 3.2+. (#526)
23
39
 
24
40
  ## 1.2.0
25
41
 
26
42
  ### Fixes
43
+
27
44
  - Fix mem_cache_store adapter with pool_size (#489)
28
45
  - Fix dalli deprecation warning about requiring 'dalli/cas/client' (#511)
29
46
  - Make transitionary method IdentityCache.with_fetch_read_only_records thread-safe (#503)
30
47
 
31
48
  ### Features
49
+
32
50
  - Add support for fill lock with lock wait to avoid thundering herd problem (#373)
33
51
 
34
52
  ## 1.1.0
35
53
 
36
54
  ### Fixes
55
+
37
56
  - Fix double debug logging of cache hits and misses (#474)
38
57
  - Fix a Rails 6.1 deprecation warning for Rails 7.0 compatibility (#482)
39
58
  - Recursively install parent expiry hooks when expiring parent caches (#476)
@@ -45,10 +64,12 @@
45
64
  - Fix fetch `has_many` embedded association on record after adding to it (#449)
46
65
 
47
66
  ### Features
67
+
48
68
  - Support multiple databases and transactional tests in `IdentityCache.should_use_cache?` (#293)
49
69
  - Add support for the default `MemCacheStore` from `ActiveSupport` (#465)
50
70
 
51
71
  ### Breaking Changes
72
+
52
73
  - Drop ruby 2.4 support, since it is no longer supported upstream (#468)
53
74
 
54
75
  ## 1.0.1
@@ -120,7 +141,7 @@
120
141
  - Remove support for 3.2
121
142
  - Fix N+1 from fetching embedded ids on a cache miss
122
143
  - Raise when trying to cache a through association. Previously it wouldn't be invalidated properly.
123
- - Raise if a class method is called on a scope. Previously the scope was ignored.
144
+ - Raise if a class method is called on a scope. Previously the scope was ignored.
124
145
  - Raise if a class method is called on a subclass of one that included IdentityCache. This never worked properly.
125
146
  - Fix cache_belongs_to on polymorphic assocations.
126
147
  - Fetching a cache_belongs_to association no longer loads the belongs_to association
@@ -181,7 +202,6 @@
181
202
 
182
203
  ## 0.0.5
183
204
 
184
-
185
205
  ## 0.0.4
186
206
 
187
207
  - Fix: only marshal attributes, embedded associations and normalized association IDs
data/Gemfile CHANGED
@@ -10,7 +10,7 @@ gem "rubocop-shopify", "~> 2.9.0", require: false
10
10
  gem "mysql2", "~> 0.5.3", platform: :mri
11
11
  gem "pg", ">= 0.18", "< 2.0", platform: :mri
12
12
  gem "memcached", "~> 1.8.0", platform: :mri
13
- gem "memcached_store", "~> 1.0.0", platform: :mri
13
+ gem "memcached_store", "~> 2.3.2", platform: :mri
14
14
  gem "dalli", "~> 2.7.11"
15
15
  gem "cityhash", "~> 0.6.0", platform: :mri
16
16
 
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.0
8
+ - ruby: 3.2.2
9
9
  - isogun
10
10
  - bundler
11
11
 
@@ -3,10 +3,10 @@ gemspec path: ".."
3
3
 
4
4
  gem "ar_transaction_changes", "~> 1.1.0"
5
5
 
6
- gem "activerecord", "~> 5.2.0"
7
- gem "mysql2", "~> 0.4.4"
8
- gem "pg", "~> 0.18.0"
6
+ gem "activerecord", "~> 7.0.0"
7
+ gem "mysql2", "~> 0.5"
8
+ gem "pg", "~> 1.1"
9
9
  gem "memcached", "~> 1.8.0"
10
- gem "memcached_store", "~> 1.0.0"
10
+ gem "memcached_store", "~> 2.3.2"
11
11
  gem "dalli", "~> 2.7.11"
12
12
  gem "cityhash", "~> 0.6.0"
@@ -31,15 +31,15 @@ Gem::Specification.new do |gem|
31
31
  gem.require_paths = ["lib"]
32
32
  gem.version = IdentityCache::VERSION
33
33
 
34
- gem.required_ruby_version = ">= 2.5.0"
34
+ gem.required_ruby_version = ">= 3.0.0"
35
35
 
36
36
  gem.metadata["allowed_push_host"] = "https://rubygems.org"
37
37
 
38
- gem.add_dependency("activerecord", ">= 5.2")
38
+ gem.add_dependency("activerecord", ">= 7.0")
39
39
  gem.add_dependency("ar_transaction_changes", "~> 1.1")
40
40
 
41
41
  gem.add_development_dependency("minitest", "~> 5.14")
42
- gem.add_development_dependency("mocha", "~> 1.12")
42
+ gem.add_development_dependency("mocha", "~> 2.0")
43
43
  gem.add_development_dependency("rake", "~> 13.0")
44
44
  gem.add_development_dependency("spy", "~> 1.0")
45
45
  end
@@ -84,7 +84,7 @@ module IdentityCache
84
84
  # This results in a single "WHERE field IN (values)" statement being
85
85
  # produced from a single query.
86
86
  field_idx = other_field_indexes.first
87
- field_name = key_fields[i]
87
+ field_name = key_fields[field_idx]
88
88
  field_values = keys.map { |key| key[field_idx] }
89
89
  (common_query || unsorted_model).where(field_name => field_values)
90
90
  else
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IdentityCache
4
- VERSION = "1.4.0"
4
+ VERSION = "1.5.0"
5
5
  CACHE_VERSION = 8
6
6
  end
@@ -116,7 +116,7 @@ module IdentityCache
116
116
  end
117
117
 
118
118
  def should_use_cache? # :nodoc:
119
- ActiveRecord::Base.connection_handler.connection_pool_list.none? do |pool|
119
+ ActiveRecord::Base.connection_handler.connection_pool_list(ActiveRecord::Base.current_role).none? do |pool|
120
120
  pool.active_connection? &&
121
121
  # Rails wraps each of your tests in a transaction, so that any changes
122
122
  # made to the database during the test can be rolled back afterwards.
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.4.0
4
+ version: 1.5.0
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: 2023-04-06 00:00:00.000000000 Z
17
+ date: 2023-11-23 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -22,14 +22,14 @@ dependencies:
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '5.2'
25
+ version: '7.0'
26
26
  type: :runtime
27
27
  prerelease: false
28
28
  version_requirements: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: '5.2'
32
+ version: '7.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: ar_transaction_changes
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '1.12'
67
+ version: '2.0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '1.12'
74
+ version: '2.0'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rake
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -183,14 +183,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - ">="
185
185
  - !ruby/object:Gem::Version
186
- version: 2.5.0
186
+ version: 3.0.0
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  requirements:
189
189
  - - ">="
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.4.10
193
+ rubygems_version: 3.4.21
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: IdentityCache lets you specify how you want to cache your model objects,