second_level_cache 2.6.2 → 2.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/second_level_cache/active_record.rb +1 -1
- data/lib/second_level_cache/version.rb +1 -1
- data/test/paranoid_test.rb +2 -0
- data/test/test_helper.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f5d055fea10f55860339d904a65bb84a51893f742d20758311e0b2c2b690727
|
4
|
+
data.tar.gz: eeba8b526efb808158e440e10bf752dbf3bc51e5f4d88878f859cf8f3b790647
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63ad5288284a4a06735175fb6171962ecde65ad08ffe9cbc112ce060e98c236150acc0b29947536fe06891144929de2ba8e744099a1c31865dccab9c2f9492c9
|
7
|
+
data.tar.gz: 559d3cde7763d4bd2645a9f416f66bdb54e74e5335004529c88f56bdfc6a3c934a6f7d5ee86aa5377405c12ad09d813ba2cf4313d43704daacd4480e9d25c782
|
@@ -13,7 +13,7 @@ require "second_level_cache/active_record/preloader"
|
|
13
13
|
# http://api.rubyonrails.org/classes/ActiveSupport/LazyLoadHooks.html
|
14
14
|
# ActiveSupport.run_load_hooks(:active_record, ActiveRecord::Base)
|
15
15
|
ActiveSupport.on_load(:active_record, run_once: true) do
|
16
|
-
if
|
16
|
+
if Bundler.definition.dependencies.find { |x| x.name == "paranoia" }
|
17
17
|
require "second_level_cache/adapter/paranoia"
|
18
18
|
include SecondLevelCache::Adapter::Paranoia::ActiveRecord
|
19
19
|
SecondLevelCache::Mixin.send(:prepend, SecondLevelCache::Adapter::Paranoia::Mixin)
|
data/test/paranoid_test.rb
CHANGED
@@ -4,10 +4,12 @@ require "test_helper"
|
|
4
4
|
|
5
5
|
class ParanoidTest < ActiveSupport::TestCase
|
6
6
|
def setup
|
7
|
+
skip unless defined?(Paranoi)
|
7
8
|
@paranoid = Paranoid.create
|
8
9
|
end
|
9
10
|
|
10
11
|
def test_should_expire_cache_when_destroy
|
12
|
+
skip unless defined(Paranoi)
|
11
13
|
@paranoid.destroy
|
12
14
|
assert_nil Paranoid.find_by(id: @paranoid.id)
|
13
15
|
assert_nil SecondLevelCache.cache_store.read(@paranoid.second_level_cache_key)
|
data/test/test_helper.rb
CHANGED
@@ -6,7 +6,6 @@ require "active_support/test_case"
|
|
6
6
|
require "active_record_test_case_helper"
|
7
7
|
require "database_cleaner"
|
8
8
|
require "active_record"
|
9
|
-
require "paranoia"
|
10
9
|
require "pry"
|
11
10
|
ActiveSupport.test_order = :sorted if ActiveSupport.respond_to?(:test_order=)
|
12
11
|
# Force hook :active_record on_load event to make sure loader can work.
|
@@ -27,7 +26,7 @@ require "model/order_item"
|
|
27
26
|
require "model/account"
|
28
27
|
require "model/animal"
|
29
28
|
require "model/contribution"
|
30
|
-
require "model/paranoid"
|
29
|
+
require "model/paranoid" if defined?(Paranoid)
|
31
30
|
|
32
31
|
DatabaseCleaner[:active_record].strategy = :truncation
|
33
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: second_level_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hooopo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|