thermos 0.5.0 → 0.5.1

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: 87ceed3d0f1b54b2cd9e9b0afde15e90252fcbc9f575c5bf11a66e414045c5d5
4
- data.tar.gz: dc3bc76cd808f474b80676c5f2d1f2e50681c6028c09412e12eb565b4494cfc4
3
+ metadata.gz: caef41475321f2d1d3286a253267f0138396addb93dda96774f3ce29502e42d4
4
+ data.tar.gz: 0b347ad89c7cbd0082c801537270d5efd140db676131985f0c65625d27f3669f
5
5
  SHA512:
6
- metadata.gz: d86ada3f6a3b07ed8bbf35c481e73ac4563a0aced184f6e47a986847287f0bf4a3c02c42e5d7600db1f5d8c2358f5ba4975fd20c4ccceee8fc3ec0cfcaae7811
7
- data.tar.gz: 51f90cb754d381d81293e433261e09cb4e184dc1dcddd05fbfcbf7baacb577330f6a4cc6a0621cc8cd9964d7677e499554a8dd533d65762adb421d56cef58458
6
+ metadata.gz: b2fcf8764757cbc90257a1b2f1a2c96aa2d39b117702b399ac9d44527e62a9bf14cf394344ffe3300d3513d88b0a9a18063696d299e282794edbcadf5d2bac9d
7
+ data.tar.gz: 2c20039b4fe427402c3ab8dbfacc83266530c0d63e169055f574ae6a433d69a772a9b4d8aa097988bced9ebb6f0c5c532963f7b0ef85f57003dbc7eb1c5e6bd7
@@ -5,7 +5,7 @@ module Thermos
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- after_commit :notify_thermos
8
+ after_commit :notify_thermos, on: %i[create update]
9
9
  end
10
10
 
11
11
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Thermos
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
data/test/thermos_test.rb CHANGED
@@ -111,6 +111,23 @@ class ThermosTest < ActiveSupport::TestCase
111
111
  assert_raises(MockExpectationError) { mock.verify }
112
112
  end
113
113
 
114
+ test "does not rebuild the cache on primary model destroy" do
115
+ mock = Minitest::Mock.new
116
+ category = categories(:baseball)
117
+
118
+ Thermos.fill(key: "key", model: Category) do |id|
119
+ mock.call(id)
120
+ end
121
+
122
+ mock.expect(:call, 1, [category.id])
123
+ assert_equal 1, Thermos.drink(key: "key", id: category.id)
124
+ mock.verify
125
+
126
+ mock.expect(:call, 2, [category.id])
127
+ category.destroy!
128
+ assert_raises(MockExpectationError) { mock.verify }
129
+ end
130
+
114
131
  test "pre-builds cache for new primary model records" do
115
132
  mock = Minitest::Mock.new
116
133
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thermos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Thal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-22 00:00:00.000000000 Z
11
+ date: 2021-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -154,53 +154,53 @@ signing_key:
154
154
  specification_version: 4
155
155
  summary: Always-warm, auto-rebuilding rails caching without timers or touching.
156
156
  test_files:
157
- - test/thermos_test.rb
157
+ - test/fixtures/category_items.yml
158
+ - test/fixtures/stores.yml
158
159
  - test/fixtures/categories.yml
159
160
  - test/fixtures/products.yml
160
- - test/fixtures/stores.yml
161
- - test/fixtures/category_items.yml
162
161
  - test/dummy/README.rdoc
163
- - test/dummy/config.ru
162
+ - test/dummy/public/404.html
163
+ - test/dummy/public/422.html
164
+ - test/dummy/public/500.html
165
+ - test/dummy/public/favicon.ico
164
166
  - test/dummy/Rakefile
165
- - test/dummy/db/schema.rb
166
- - test/dummy/db/migrate/20160325214744_create_categories.rb
167
- - test/dummy/db/migrate/20160326174530_create_stores.rb
168
- - test/dummy/db/migrate/20160325214849_create_products.rb
169
- - test/dummy/db/migrate/20160325220006_create_category_items.rb
170
- - test/dummy/config/environment.rb
171
- - test/dummy/config/secrets.yml
172
167
  - test/dummy/config/application.rb
168
+ - test/dummy/config/routes.rb
169
+ - test/dummy/config/environments/production.rb
173
170
  - test/dummy/config/environments/test.rb
174
171
  - test/dummy/config/environments/development.rb
175
- - test/dummy/config/environments/production.rb
176
- - test/dummy/config/boot.rb
177
- - test/dummy/config/locales/en.yml
178
172
  - test/dummy/config/database.yml
179
- - test/dummy/config/initializers/cookies_serializer.rb
180
- - test/dummy/config/initializers/assets.rb
181
173
  - test/dummy/config/initializers/backtrace_silencers.rb
182
- - test/dummy/config/initializers/mime_types.rb
183
- - test/dummy/config/initializers/session_store.rb
174
+ - test/dummy/config/initializers/assets.rb
184
175
  - test/dummy/config/initializers/wrap_parameters.rb
185
176
  - test/dummy/config/initializers/filter_parameter_logging.rb
177
+ - test/dummy/config/initializers/session_store.rb
186
178
  - test/dummy/config/initializers/inflections.rb
187
- - test/dummy/config/routes.rb
188
- - test/dummy/public/500.html
189
- - test/dummy/public/404.html
190
- - test/dummy/public/422.html
191
- - test/dummy/public/favicon.ico
179
+ - test/dummy/config/initializers/mime_types.rb
180
+ - test/dummy/config/initializers/cookies_serializer.rb
181
+ - test/dummy/config/locales/en.yml
182
+ - test/dummy/config/environment.rb
183
+ - test/dummy/config/secrets.yml
184
+ - test/dummy/config/boot.rb
192
185
  - test/dummy/app/models/category_item.rb
193
- - test/dummy/app/models/product.rb
194
186
  - test/dummy/app/models/category.rb
195
187
  - test/dummy/app/models/store.rb
196
- - test/dummy/app/helpers/application_helper.rb
188
+ - test/dummy/app/models/product.rb
197
189
  - test/dummy/app/views/layouts/application.html.erb
198
190
  - test/dummy/app/assets/javascripts/application.js
199
191
  - test/dummy/app/assets/stylesheets/application.css
200
192
  - test/dummy/app/assets/config/manifest.js
201
193
  - test/dummy/app/controllers/application_controller.rb
202
- - test/dummy/bin/setup
203
- - test/dummy/bin/bundle
204
- - test/dummy/bin/rake
194
+ - test/dummy/app/helpers/application_helper.rb
195
+ - test/dummy/config.ru
196
+ - test/dummy/db/migrate/20160325214849_create_products.rb
197
+ - test/dummy/db/migrate/20160325220006_create_category_items.rb
198
+ - test/dummy/db/migrate/20160326174530_create_stores.rb
199
+ - test/dummy/db/migrate/20160325214744_create_categories.rb
200
+ - test/dummy/db/schema.rb
205
201
  - test/dummy/bin/rails
202
+ - test/dummy/bin/rake
203
+ - test/dummy/bin/bundle
204
+ - test/dummy/bin/setup
205
+ - test/thermos_test.rb
206
206
  - test/test_helper.rb