identity_cache 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0238eadfff3efbdc9ad2e6625ce51fa8bc43cf722f317ab096cf4dcf42b8ab11'
4
- data.tar.gz: 8f6c334a2bcc97cceef427cb626dfd5cdd7528982a1062356113217e9268f836
3
+ metadata.gz: 1cb45582de9a181e4b32595a183630023ba9af3a84ed5123308eada240420ab8
4
+ data.tar.gz: 46ce8b2795adbd03ca67d69ba9ddd725ac1b7bcbf56ac85344ee220380495ad4
5
5
  SHA512:
6
- metadata.gz: 30132bc792a1095e821ddd2602cf6a7edead2f52a50f4a6d1fa75ab22321d4459172aa6de95760693ad069895d741b4756fc5b827581eea4d23b6beb813b7c21
7
- data.tar.gz: b93b51adc8d89c33eb5e051f98e9f6637bd16e9c0fa4640a4b23bdea241548a428d3ea5dcc582922166d04096479bf1a62e27ba587029d2428e47bc9dacfea1f
6
+ metadata.gz: 5a4053d1a93c89a058593fc998dad0c77ac32aae4d691db3087bd88743bae2aa76193112262e0ac536468c3ddc14ceef5fd34e2d770d7e8d3129d83df65d604d
7
+ data.tar.gz: e397cb05b4d7bc5a3a6304fc4346ac63318c043c44dee032730af30c23a19d42168f0390039d6986aeef33dfda28e99dda831ca23dca8ea217a356d736dccd6e
@@ -19,11 +19,11 @@ jobs:
19
19
  ruby: '3.0'
20
20
  gemfile: "Gemfile.min-supported"
21
21
  - name: 'Latest released & run rubocop'
22
- ruby: '3.2'
22
+ ruby: '3.3'
23
23
  gemfile: "Gemfile.latest-release"
24
24
  rubocop: true
25
25
  - name: 'Rails edge'
26
- ruby: '3.2'
26
+ ruby: '3.3'
27
27
  gemfile: "Gemfile.rails-edge"
28
28
  edge: true
29
29
 
@@ -69,25 +69,26 @@ jobs:
69
69
  run: |
70
70
  sudo apt-get update
71
71
  sudo apt-get -y install libmemcached-dev libmysqlclient-dev libpq-dev libsasl2-dev
72
+
72
73
  - uses: actions/checkout@v2
73
74
  - name: Set up Ruby
74
75
  uses: ruby/setup-ruby@v1
75
76
  with:
76
77
  ruby-version: ${{ matrix.entry.ruby }}
77
- - name: Install bundler and gems
78
- run: |
79
- gem install bundler
80
- bundle install --jobs 4 --retry 3
78
+ bundler-cache: true
79
+
81
80
  - name: Test with mysql
82
81
  env:
83
82
  DB: mysql2
84
83
  run: bundle exec rake test
84
+
85
85
  - name: Test with postgres and memcached_store
86
86
  env:
87
87
  DB: postgresql
88
88
  POSTGRES_PASSWORD: postgres
89
89
  ADAPTER: memcached
90
90
  run: bundle exec rake test
91
+
91
92
  - name: Run rubocop
92
93
  if: matrix.entry.rubocop
93
94
  run: bundle exec rubocop
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.3.4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.6.1
6
+
7
+ - Fix deprecation warnings on Active Record 7.2. (#575)
8
+
5
9
  ## 1.6.0
6
10
 
7
11
  - Introduce `.with_deferred_parent_expiration`, which takes a block and avoids duplicate parent cache expiry. (#569)
data/Gemfile CHANGED
@@ -9,7 +9,7 @@ gem "rubocop-shopify", "~> 2.9.0", require: false
9
9
 
10
10
  gem "mysql2", "~> 0.5.3", platform: :mri
11
11
  gem "pg", ">= 0.18", "< 2.0", platform: :mri
12
- gem "memcached", "~> 1.8.0", platform: :mri
12
+ gem "memcached", github: "Shopify/memcached", branch: "1-0-stable-shopify", platform: :mri
13
13
  gem "memcached_store", "~> 2.3.2", platform: :mri
14
14
  gem "dalli", "~> 3.2.3"
15
15
  gem "cityhash", "~> 0.6.0", platform: :mri
data/Gemfile.lock CHANGED
@@ -1,52 +1,59 @@
1
+ GIT
2
+ remote: https://github.com/Shopify/memcached.git
3
+ revision: 54a89bae698896a00fd2ceeb142dada6285f73ed
4
+ branch: 1-0-stable-shopify
5
+ specs:
6
+ memcached (1.9.0)
7
+
1
8
  PATH
2
9
  remote: .
3
10
  specs:
4
- identity_cache (1.6.0)
11
+ identity_cache (1.6.1)
5
12
  activerecord (>= 7.0)
6
13
  ar_transaction_changes (~> 1.1)
7
14
 
8
15
  GEM
9
16
  remote: https://rubygems.org/
10
17
  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)
18
+ activemodel (7.2.0)
19
+ activesupport (= 7.2.0)
20
+ activerecord (7.2.0)
21
+ activemodel (= 7.2.0)
22
+ activesupport (= 7.2.0)
16
23
  timeout (>= 0.4.0)
17
- activesupport (7.1.3.2)
24
+ activesupport (7.2.0)
18
25
  base64
19
26
  bigdecimal
20
- concurrent-ruby (~> 1.0, >= 1.0.2)
27
+ concurrent-ruby (~> 1.0, >= 1.3.1)
21
28
  connection_pool (>= 2.2.5)
22
29
  drb
23
30
  i18n (>= 1.6, < 2)
31
+ logger (>= 1.4.2)
24
32
  minitest (>= 5.1)
25
- mutex_m
26
- tzinfo (~> 2.0)
33
+ securerandom (>= 0.3)
34
+ tzinfo (~> 2.0, >= 2.0.5)
27
35
  ar_transaction_changes (1.1.9)
28
36
  activerecord (>= 5.2.0)
29
37
  ast (2.4.2)
30
38
  base64 (0.2.0)
31
- bigdecimal (3.1.6)
39
+ bigdecimal (3.1.8)
32
40
  byebug (11.1.3)
33
41
  cityhash (0.6.0)
34
- concurrent-ruby (1.2.3)
42
+ concurrent-ruby (1.3.4)
35
43
  connection_pool (2.4.1)
36
44
  dalli (3.2.3)
37
45
  drb (2.2.1)
38
- i18n (1.14.4)
46
+ i18n (1.14.5)
39
47
  concurrent-ruby (~> 1.0)
40
48
  json (2.7.1)
41
49
  language_server-protocol (3.17.0.3)
42
- memcached (1.8.0)
50
+ logger (1.6.0)
43
51
  memcached_store (2.3.4)
44
52
  activesupport (>= 6)
45
53
  memcached (~> 1.8)
46
- minitest (5.22.2)
54
+ minitest (5.25.1)
47
55
  mocha (2.1.0)
48
56
  ruby2_keywords (>= 0.0.5)
49
- mutex_m (0.2.0)
50
57
  mysql2 (0.5.6)
51
58
  parallel (1.24.0)
52
59
  parser (3.3.0.5)
@@ -76,6 +83,7 @@ GEM
76
83
  rubocop (~> 1.33)
77
84
  ruby-progressbar (1.13.0)
78
85
  ruby2_keywords (0.0.5)
86
+ securerandom (0.3.1)
79
87
  spy (1.0.5)
80
88
  stackprof (0.2.26)
81
89
  strscan (3.1.0)
@@ -94,7 +102,7 @@ DEPENDENCIES
94
102
  cityhash (~> 0.6.0)
95
103
  dalli (~> 3.2.3)
96
104
  identity_cache!
97
- memcached (~> 1.8.0)
105
+ memcached!
98
106
  memcached_store (~> 2.3.2)
99
107
  minitest (~> 5.14)
100
108
  mocha (~> 2.0)
data/dev.yml CHANGED
@@ -1,18 +1,10 @@
1
1
  name: identity-cache
2
2
 
3
3
  up:
4
- - homebrew:
5
- - mysql-client@5.7:
6
- or: [mysql@5.7]
7
- conflicts: [mysql-connector-c, mysql, mysql-client]
8
4
  - ruby
9
- - isogun
10
5
  - bundler
11
-
12
- env:
13
- RAILGUN_HOST: identity-cache.railgun
14
- MYSQL_HOST: identity-cache.railgun
15
- MEMCACHED_HOST: identity-cache.railgun
6
+ - memcached
7
+ - mysql
16
8
 
17
9
  commands:
18
10
  test:
@@ -8,6 +8,7 @@ gem "activerecord"
8
8
  gem "activesupport"
9
9
  gem "mysql2", "~> 0.5"
10
10
  gem "pg", "~> 1.1"
11
+ gem "memcached", github: "Shopify/memcached", branch: "1-0-stable-shopify"
11
12
  gem "memcached_store"
12
13
  gem "dalli"
13
14
  gem "cityhash"
@@ -6,7 +6,7 @@ gem "ar_transaction_changes", "~> 1.1.0"
6
6
  gem "activerecord", "~> 7.0.0"
7
7
  gem "mysql2", "~> 0.5"
8
8
  gem "pg", "~> 1.1"
9
- gem "memcached", "~> 1.8.0"
9
+ gem "memcached", github: "Shopify/memcached", branch: "1-0-stable-shopify"
10
10
  gem "memcached_store", "~> 2.3.2"
11
11
  gem "dalli", "~> 2.7.11"
12
12
  gem "cityhash", "~> 0.6.0"
@@ -5,6 +5,7 @@ gem "activerecord", github: "rails/rails", branch: "main"
5
5
  gem "activesupport", github: "rails/rails", branch: "main"
6
6
  gem "mysql2", "~> 0.5"
7
7
  gem "pg", "~> 1.1"
8
+ gem "memcached", github: "Shopify/memcached", branch: "1-0-stable-shopify"
8
9
  gem "memcached_store"
9
10
  gem "dalli"
10
11
  gem "cityhash"
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IdentityCache
4
- VERSION = "1.6.0"
4
+ VERSION = "1.6.1"
5
5
  CACHE_VERSION = 8
6
6
  end
@@ -117,27 +117,36 @@ module IdentityCache
117
117
  !readonly
118
118
  end
119
119
 
120
- def should_use_cache? # :nodoc:
121
- ActiveRecord::Base.connection_handler.connection_pool_list(ActiveRecord::Base.current_role).none? do |pool|
122
- pool.active_connection? &&
123
- # Rails wraps each of your tests in a transaction, so that any changes
124
- # made to the database during the test can be rolled back afterwards.
125
- # These transactions are flagged as "unjoinable", which tries to make
126
- # your application behave as if they weren't there. In particular:
127
- #
128
- # - Opening another transaction during the test creates a savepoint,
129
- # which can be rolled back independently of the main transaction.
130
- # - When those nested transactions complete, any `after_commit`
131
- # callbacks for records modified during the transaction will run,
132
- # even though the changes haven't actually been committed yet.
133
- #
134
- # By ignoring unjoinable transactions, IdentityCache's behaviour
135
- # during your test suite will more closely match production.
136
- #
137
- # When there are no open transactions, `current_transaction` returns a
138
- # special `NullTransaction` object that is unjoinable, meaning we will
139
- # use the cache.
140
- pool.connection.current_transaction.joinable?
120
+ # Rails wraps each of your tests in a transaction, so that any changes
121
+ # made to the database during the test can be rolled back afterwards.
122
+ # These transactions are flagged as "unjoinable", which tries to make
123
+ # your application behave as if they weren't there. In particular:
124
+ #
125
+ # - Opening another transaction during the test creates a savepoint,
126
+ # which can be rolled back independently of the main transaction.
127
+ # - When those nested transactions complete, any `after_commit`
128
+ # callbacks for records modified during the transaction will run,
129
+ # even though the changes haven't actually been committed yet.
130
+ #
131
+ # By ignoring unjoinable transactions, IdentityCache's behaviour
132
+ # during your test suite will more closely match production.
133
+ #
134
+ # When there are no open transactions, `current_transaction` returns a
135
+ # special `NullTransaction` object that is unjoinable, meaning we will
136
+ # use the cache.
137
+ if ActiveRecord::ConnectionAdapters::ConnectionPool.method_defined?(:active_connection)
138
+ def should_use_cache? # :nodoc:
139
+ ActiveRecord::Base.connection_handler.connection_pool_list(ActiveRecord::Base.current_role).none? do |pool|
140
+ pool.active_connection? &&
141
+ pool.active_connection.current_transaction.joinable?
142
+ end
143
+ end
144
+ else
145
+ def should_use_cache? # :nodoc:
146
+ ActiveRecord::Base.connection_handler.connection_pool_list(ActiveRecord::Base.current_role).none? do |pool|
147
+ pool.active_connection? &&
148
+ pool.connection.current_transaction.joinable?
149
+ end
141
150
  end
142
151
  end
143
152
 
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.6.0
4
+ version: 1.6.1
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-07-05 00:00:00.000000000 Z
17
+ date: 2024-08-21 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: activerecord
@@ -127,7 +127,6 @@ files:
127
127
  - gemfiles/Gemfile.min-supported
128
128
  - gemfiles/Gemfile.rails-edge
129
129
  - identity_cache.gemspec
130
- - isogun.yml
131
130
  - lib/identity_cache.rb
132
131
  - lib/identity_cache/belongs_to_caching.rb
133
132
  - lib/identity_cache/cache_fetcher.rb
@@ -192,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
191
  - !ruby/object:Gem::Version
193
192
  version: '0'
194
193
  requirements: []
195
- rubygems_version: 3.5.14
194
+ rubygems_version: 3.5.17
196
195
  signing_key:
197
196
  specification_version: 4
198
197
  summary: IdentityCache lets you specify how you want to cache your model objects,
data/isogun.yml DELETED
@@ -1,11 +0,0 @@
1
- # https://dev-accel.shopify.io/dev/railgun/Railgun-Config
2
- name: identity-cache
3
-
4
- vm:
5
- ip_address: 192.168.64.98
6
- memory: 1G
7
- cores: 2
8
-
9
- services:
10
- - mysql
11
- - memcached