second_level_cache 2.2.5 → 2.2.6

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
  SHA1:
3
- metadata.gz: 468998db30f121cb2fe6759f3c7bc59beb70685f
4
- data.tar.gz: efbb401b2975b3dc97a9cc639f3b1147e4c95332
3
+ metadata.gz: 9040d6157f9c761c4b806764f7007b44f6c9c483
4
+ data.tar.gz: bd364513a045cd7817b4fa7b9b86d5a0e2a6e93c
5
5
  SHA512:
6
- metadata.gz: 2716b6392268aa3973b383994c87ba269feb5d59a420491ac3a61e334d3072c215fe9909ef242446aa7469bcd444a5262a830fb03af8b476245dce52da394a76
7
- data.tar.gz: 66f5a460fd82d11a97dbc685410ea33a2de792c232aa3116eb3ccf50b36603ed4b209df16dede9fc8f3b099073396b51a895ede1cf5a1d02739a4eb6be9aa469
6
+ metadata.gz: 1e1970b11a1dcb57cba266b95f71680f01bafafab459f91feb950ccee18a628eeb40563867f8c9f6bbf6a898fe7ad089186dabde46f4779c3989dda1b0d7b301
7
+ data.tar.gz: 7894b59c9ecfcd52b5cb03bdbff19f9d6a088c490d34453a6170793a03171e703233e2f5a543d4037279726e80f8a4ac6699b62822c0e07ea8c59cfb0e145476
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ 2.2.5
2
+ -----
3
+
4
+ * Flush cache when belongs_to keys are changed; (#51)
5
+ * Fix #52 in ActiveRecord 5.0.1, `records_for` API has changed, it's want an `ActiveRecord::Relation` instance to include a `load` method, but second_level_cached returned an Array. (#53)
6
+ * Fix Rails 5.0.1 `@second_level_cache_enabled` not define warning.
7
+
8
+ 2.2.4
9
+ -----
10
+
11
+ * Fix update conflict in same thread or request context for Cache object. (#49)
12
+
13
+ 2.2.3
14
+ -----
15
+
16
+ * Fix issue with Rails enums. (#43)
17
+ * Fix to update cache on `update_columns`, `update_attribute`. (#43)
18
+
1
19
  2.2.2
2
20
  -----
3
21
 
@@ -9,8 +27,9 @@
9
27
  * ActiveRecord 5 ready! Do not support ActiveRecord 4 and lower versions now (use second_level_cache 2.1.x).
10
28
  * Requirement Ruby 2.3+.
11
29
 
12
- 2.0.0.rc1
30
+ 2.0.0
13
31
  -----
32
+
14
33
  * ActiveRecord 4 ready!
15
34
  * read multi support for preloading. `Article.includes(:user).limit(5).to_a` will fetch all articles' users from cache preferentially.
16
35
  * remove dependency warning
@@ -18,53 +37,65 @@
18
37
 
19
38
  1.6.2
20
39
  -----
40
+
21
41
  * [can disable/enable fetch_by_uinq_key method]
22
42
  * [Fix Bug: serialized attribute columns marshal issue #11]
23
43
 
24
44
  1.6.1
25
45
  -----
46
+
26
47
  * [Fix bug: undefined method `select_all_column?' for []:ActiveRecord::Relation] by sishen
27
48
 
28
49
  1.6.0
29
50
  -----
51
+
30
52
  * [write through cache]
31
53
  * [disable SecondLevelCache for spicial model]
32
54
  * [only cache `SELECT *` query]
33
55
 
34
56
  1.5.1
35
57
  -----
58
+
36
59
  * [use new marshal machanism to avoid clear assocation cache manually]
37
60
 
38
61
  1.5.0
39
62
  -----
63
+
40
64
  * [add cache version to quick clear cache for special model]
41
65
 
42
66
  1.4.1
43
67
  -----
68
+
44
69
  * [fix errors when belongs_to association return nil]
45
70
 
46
71
  1.4.0
47
72
  -----
73
+
48
74
  * [cache has one assciation]
49
75
 
50
76
  1.3.2
51
77
  -----
78
+
52
79
  * [fix has one assciation issue]
53
80
 
54
81
  1.3.1
55
82
  -----
83
+
56
84
  * [clean cache after update_column/increment!/decrement!]
57
85
 
58
86
  1.3.0
59
87
  -----
88
+
60
89
  * [clean cache after touch]
61
90
 
62
91
  1.2.1
63
92
  -----
93
+
64
94
  * [fix polymorphic association bug]
65
95
 
66
96
  1.2.0
67
97
  -----
98
+
68
99
  * [clear cache after update_counters](https://github.com/csdn-dev/second_level_cache/commit/240dde81199124092e0e8ad0500c167ac146e301)
69
100
 
70
101
 
data/README.md CHANGED
@@ -19,7 +19,7 @@ In your gem file:
19
19
  ActiveRecord 5:
20
20
 
21
21
  ```ruby
22
- gem 'second_level_cache', '~> 2.2.4'
22
+ gem 'second_level_cache', '~> 2.2.6'
23
23
  ```
24
24
 
25
25
  For ActiveRecord 4:
@@ -9,7 +9,7 @@ module SecondLevelCache
9
9
 
10
10
  module ClassMethods
11
11
  def find(*ids)
12
- return all.find(ids.first) if ids.size == 1 && ids.first.is_a?(Fixnum)
12
+ return all.find(ids.first) if ids.size == 1
13
13
  super(*ids)
14
14
  end
15
15
  end
@@ -1,7 +1,7 @@
1
1
  module SecondLevelCache
2
2
  class Config
3
3
  class << self
4
- attr_accessor :cache_store, :logger, :cache_key_prefix
4
+ attr_writer :cache_store, :logger, :cache_key_prefix
5
5
 
6
6
  def cache_store
7
7
  @cache_store ||= Rails.cache if defined?(Rails)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module SecondLevelCache
3
- VERSION = '2.2.5'.freeze
3
+ VERSION = '2.2.6'.freeze
4
4
  end
@@ -10,6 +10,14 @@ class FinderMethodsTest < ActiveSupport::TestCase
10
10
  assert_equal @user, User.find(@user.id)
11
11
  end
12
12
 
13
+ def test_should_find_with_string_id
14
+ SecondLevelCache.cache_store.clear
15
+ assert_equal @user, User.find(@user.id.to_s)
16
+ assert_no_queries do
17
+ assert_equal @user, User.find(@user.id.to_s)
18
+ end
19
+ end
20
+
13
21
  def test_should_find_with_cache
14
22
  @user.write_second_level_cache
15
23
  assert_no_queries do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: second_level_cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hooopo