second_level_cache 2.4.0 → 2.4.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
- SHA256:
3
- metadata.gz: d4a105d17a40787d4a614e3870220cc480befc73713872f7d427f009d36c7eea
4
- data.tar.gz: 1488f0f970f62dc8605d4a669b2b8b9e0b88cc1eb9e7f26961ab2611983b1f41
2
+ SHA1:
3
+ metadata.gz: 041a857d039324cda299622c23936f20fe9d83f9
4
+ data.tar.gz: 5a4ce5a3a3c1638eb74f9379d0f8421008c6b834
5
5
  SHA512:
6
- metadata.gz: f240c1fb0e9388e873e8fb40506dca51f12c867447ef091d5d88adb828f1a6d53a151be1aab047028172df4c298a4a691fdc3792d1e3df14c53d6c024557c73c
7
- data.tar.gz: 44d71c5531ef6c704303b9e02173b439feff1a0884120b3bd56e07c96a6482baba8218ba1e42201f1ca0a06a1e344440390b0944e5833266e1d04bf6fc7ea79a
6
+ metadata.gz: 9444daff1fdeb5378db6ea2dc3e907744f2035dada6cb9b94bf47b88fa6894639a371438a02b2577ed41459d856c2b065240e322cbc156884abfaf8409c2b3ed
7
+ data.tar.gz: 1e84301c16f4129f130503e1fcc7096a19cf8213e6937cedfae1724422fc793e6246bed7f66e44fac1a757dcab2a2bb13588280abc8ac2b479ed520d5ab70171
@@ -20,7 +20,7 @@ ActiveSupport.on_load(:active_record) do
20
20
 
21
21
  ActiveRecord::Associations::BelongsToAssociation.send(:prepend, SecondLevelCache::ActiveRecord::Associations::BelongsToAssociation)
22
22
  ActiveRecord::Associations::HasOneAssociation.send(:prepend, SecondLevelCache::ActiveRecord::Associations::HasOneAssociation)
23
-
23
+ ActiveRecord::Relation.send(:prepend, SecondLevelCache::ActiveRecord::FinderMethods)
24
24
  # Rails 5.2 has removed ActiveRecord::Associations::Preloader::BelongsTo
25
25
  # https://github.com/rails/rails/pull/31079
26
26
  ActiveRecord::Associations::Preloader::Association.send(:prepend, SecondLevelCache::ActiveRecord::Associations::Preloader::BelongsTo)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SecondLevelCache
4
- VERSION = "2.4.0"
4
+ VERSION = "2.4.1"
5
5
  end
@@ -5,6 +5,7 @@ require "test_helper"
5
5
  class FinderMethodsTest < ActiveSupport::TestCase
6
6
  def setup
7
7
  @user = User.create name: "csdn", email: "test@csdn.com"
8
+ @book = @user.books.create
8
9
  end
9
10
 
10
11
  def test_should_find_without_cache
@@ -20,6 +21,13 @@ class FinderMethodsTest < ActiveSupport::TestCase
20
21
  end
21
22
  end
22
23
 
24
+ def test_should_find_with_has_many
25
+ @book.write_second_level_cache
26
+ assert_no_queries do
27
+ assert_equal @book, @user.books.find(@book.id)
28
+ end
29
+ end
30
+
23
31
  def test_should_find_with_cache
24
32
  @user.write_second_level_cache
25
33
  assert_no_queries do
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.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hooopo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-23 00:00:00.000000000 Z
11
+ date: 2018-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  requirements: []
194
194
  rubyforge_project:
195
- rubygems_version: 2.7.3
195
+ rubygems_version: 2.6.11
196
196
  signing_key:
197
197
  specification_version: 4
198
198
  summary: 'SecondLevelCache is a write-through and read-through caching library inspired