second_level_cache 2.2.3 → 2.2.4

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
  SHA1:
3
- metadata.gz: 7ce12cd0acb8898804a3fc70bbb9233292c6bd22
4
- data.tar.gz: 99cd8136503846c6c6f990993ac92f962ec52131
3
+ metadata.gz: 05c9987992ee5a153440093cb5790b0f3d1e64d0
4
+ data.tar.gz: d8a274ec93948824185855cf1b8fb788aa844c34
5
5
  SHA512:
6
- metadata.gz: bd5fbfcd0a891a32d1533de644842466666af3bcccd050c149d383bd369503779c8a19f982f4cdf2e10926ad32ffe2345fb86a581d8dcc4f6e51ae800d2150cf
7
- data.tar.gz: f513fd3a81f95a8ddd029fc7265de7bd76737f6feaf5745c50f793a96f2f8519562cb3c42888b41d75dca6ed16883ede4f058271a382c812236a94034cc327c2
6
+ metadata.gz: 58c4cb72d3ae8a74f39ab0a0a5dc71b44ba254d51e53e120f099486bdc7fdf0204434d069ebdbe2a30f66b3c90b9840d97ec6130599e98328fc00feef305ad33
7
+ data.tar.gz: a32c661bbe6d71fabea69d3079a795ce9ec51315613fda3b26a1f163220c30f147b3c3c37cf843d0f113e0e2e41f5527b33aad5801af17a259f5c455e61b394a
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.3'
22
+ gem 'second_level_cache', '~> 2.2.4'
23
23
  ```
24
24
 
25
25
  For ActiveRecord 4:
@@ -37,7 +37,7 @@ module RecordMarshal
37
37
  end
38
38
 
39
39
  klass.defined_enums.each do |key, value|
40
- attributes[key] = value[attributes[key]]
40
+ attributes[key] = value[attributes[key]] if attributes[key].is_a?(String)
41
41
  end
42
42
 
43
43
  klass.instantiate(attributes)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module SecondLevelCache
3
- VERSION = '2.2.3'.freeze
3
+ VERSION = '2.2.4'.freeze
4
4
  end
@@ -3,11 +3,12 @@ require 'test_helper'
3
3
  class RecordMarshalTest < ActiveSupport::TestCase
4
4
  def setup
5
5
  if ::ActiveRecord::VERSION::STRING >= '4.1.0'
6
- @json_options = { 'name' => 'Test', 'age' => 18 }
6
+ @json_options = { 'name' => 'Test', 'age' => 18, 'hash' => { 'name' => 'dup' } }
7
7
  @user = User.create name: 'csdn',
8
8
  email: 'test@csdn.com',
9
9
  options: [1, 2],
10
- json_options: @json_options
10
+ json_options: @json_options,
11
+ status: :active
11
12
  else
12
13
  @user = User.create name: 'csdn',
13
14
  email: 'test@csdn.com',
@@ -47,4 +48,11 @@ class RecordMarshalTest < ActiveSupport::TestCase
47
48
  @user.write_second_level_cache
48
49
  assert_equal false, User.read_second_level_cache(@user.id).association_cached?('id')
49
50
  end
51
+
52
+ def test_should_thread_safe_load
53
+ user = User.find @user.id
54
+ assert_equal 'active', user.status
55
+ user = User.find @user.id
56
+ assert_equal 'active', user.status
57
+ end
50
58
  end
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.2.3
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hooopo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-01 00:00:00.000000000 Z
11
+ date: 2016-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -188,7 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  version: '0'
189
189
  requirements: []
190
190
  rubyforge_project:
191
- rubygems_version: 2.4.5.1
191
+ rubygems_version: 2.5.1
192
192
  signing_key:
193
193
  specification_version: 4
194
194
  summary: 'SecondLevelCache is a write-through and read-through caching library inspired