second_level_cache 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,7 @@ module SecondLevelCache
|
|
3
3
|
module ActiveRecord
|
4
4
|
module FetchByUniqKey
|
5
5
|
def fetch_by_uniq_key(value, uniq_key_name)
|
6
|
+
return self.where(uniq_key_name => value).first unless self.second_level_cache_enabled?
|
6
7
|
if iid = SecondLevelCache.cache_store.read(cache_uniq_key(value, uniq_key_name))
|
7
8
|
self.find_by_id(iid)
|
8
9
|
else
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
ActiveRecord::Base.connection.create_table(:users, :force => true) do |t|
|
3
|
+
t.text :options
|
3
4
|
t.string :name
|
4
5
|
t.string :email
|
5
6
|
t.integer :books_count, :default => 0
|
@@ -9,6 +10,7 @@ end
|
|
9
10
|
|
10
11
|
class User < ActiveRecord::Base
|
11
12
|
CacheVersion = 3
|
13
|
+
serialize :options, Array
|
12
14
|
acts_as_cached(:version => CacheVersion, :expires_in => 3.day)
|
13
15
|
|
14
16
|
has_many :books
|
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: second_level_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- wangxz
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-
|
12
|
+
date: 2013-04-16 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: activesupport
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ~>
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: activerecord
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ~>
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :development
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ~>
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,29 +46,33 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: sqlite3
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
|
-
- - '>='
|
51
|
+
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
|
-
- - '>='
|
59
|
+
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: rake
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
|
-
- - '>='
|
67
|
+
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
61
69
|
version: '0'
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
|
-
- - '>='
|
75
|
+
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '0'
|
69
78
|
description: Write Through and Read Through caching library inspired by CacheMoney
|
@@ -74,80 +83,82 @@ executables: []
|
|
74
83
|
extensions: []
|
75
84
|
extra_rdoc_files: []
|
76
85
|
files:
|
77
|
-
- lib/second_level_cache
|
78
|
-
- lib/second_level_cache/
|
86
|
+
- lib/second_level_cache.rb
|
87
|
+
- lib/second_level_cache/config.rb
|
88
|
+
- lib/second_level_cache/active_record.rb
|
79
89
|
- lib/second_level_cache/active_record/fetch_by_uniq_key.rb
|
90
|
+
- lib/second_level_cache/active_record/persistence.rb
|
91
|
+
- lib/second_level_cache/active_record/base.rb
|
80
92
|
- lib/second_level_cache/active_record/finder_methods.rb
|
93
|
+
- lib/second_level_cache/active_record/belongs_to_association.rb
|
81
94
|
- lib/second_level_cache/active_record/has_one_association.rb
|
82
|
-
- lib/second_level_cache/active_record/persistence.rb
|
83
|
-
- lib/second_level_cache/active_record.rb
|
84
|
-
- lib/second_level_cache/arel/wheres.rb
|
85
|
-
- lib/second_level_cache/config.rb
|
86
95
|
- lib/second_level_cache/record_marshal.rb
|
87
96
|
- lib/second_level_cache/version.rb
|
88
|
-
- lib/second_level_cache.rb
|
97
|
+
- lib/second_level_cache/arel/wheres.rb
|
89
98
|
- README.md
|
90
99
|
- Rakefile
|
91
100
|
- Gemfile
|
92
101
|
- init.rb
|
93
102
|
- CHANGELOG.md
|
94
103
|
- second_level_cache.gemspec
|
95
|
-
- test/
|
96
|
-
- test/active_record/belongs_to_association_test.rb
|
104
|
+
- test/require_test.rb
|
97
105
|
- test/active_record/finder_methods_test.rb
|
98
|
-
- test/active_record/
|
106
|
+
- test/active_record/belongs_to_association_test.rb
|
107
|
+
- test/active_record/base_test.rb
|
108
|
+
- test/active_record/persistence_test.rb
|
109
|
+
- test/active_record/test_helper.rb
|
110
|
+
- test/active_record/polymorphic_association_test.rb
|
99
111
|
- test/active_record/model/image.rb
|
100
112
|
- test/active_record/model/post.rb
|
101
|
-
- test/active_record/model/
|
113
|
+
- test/active_record/model/book.rb
|
102
114
|
- test/active_record/model/user.rb
|
103
|
-
- test/active_record/
|
104
|
-
- test/active_record/polymorphic_association_test.rb
|
115
|
+
- test/active_record/model/topic.rb
|
105
116
|
- test/active_record/second_level_cache_test.rb
|
106
|
-
- test/active_record/test_helper.rb
|
107
117
|
- test/record_marshal_test.rb
|
108
|
-
- test/require_test.rb
|
109
118
|
- test/test_helper.rb
|
110
119
|
homepage: https://github.com/csdn-dev/second_level_cache
|
111
120
|
licenses: []
|
112
|
-
metadata: {}
|
113
121
|
post_install_message:
|
114
122
|
rdoc_options: []
|
115
123
|
require_paths:
|
116
124
|
- lib
|
117
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
126
|
+
none: false
|
118
127
|
requirements:
|
119
|
-
- - '>='
|
128
|
+
- - ! '>='
|
120
129
|
- !ruby/object:Gem::Version
|
121
130
|
version: '0'
|
122
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
123
133
|
requirements:
|
124
|
-
- - '>='
|
134
|
+
- - ! '>='
|
125
135
|
- !ruby/object:Gem::Version
|
126
136
|
version: '0'
|
127
137
|
requirements: []
|
128
138
|
rubyforge_project:
|
129
|
-
rubygems_version:
|
139
|
+
rubygems_version: 1.8.24
|
130
140
|
signing_key:
|
131
|
-
specification_version:
|
132
|
-
summary: 'SecondLevelCache is a write-through and read-through caching library inspired
|
141
|
+
specification_version: 3
|
142
|
+
summary: ! 'SecondLevelCache is a write-through and read-through caching library inspired
|
133
143
|
by Cache Money and cache_fu, support only Rails3 and ActiveRecord. Read-Through:
|
134
144
|
Queries by ID, like current_user.articles.find(params[:id]), will first look in
|
135
145
|
cache store and then look in the database for the results of that query. If there
|
136
146
|
is a cache miss, it will populate the cache. Write-Through: As objects are created,
|
137
147
|
updated, and deleted, all of the caches are automatically kept up-to-date and coherent.'
|
138
148
|
test_files:
|
139
|
-
- test/
|
140
|
-
- test/active_record/belongs_to_association_test.rb
|
149
|
+
- test/require_test.rb
|
141
150
|
- test/active_record/finder_methods_test.rb
|
142
|
-
- test/active_record/
|
151
|
+
- test/active_record/belongs_to_association_test.rb
|
152
|
+
- test/active_record/base_test.rb
|
153
|
+
- test/active_record/persistence_test.rb
|
154
|
+
- test/active_record/test_helper.rb
|
155
|
+
- test/active_record/polymorphic_association_test.rb
|
143
156
|
- test/active_record/model/image.rb
|
144
157
|
- test/active_record/model/post.rb
|
145
|
-
- test/active_record/model/
|
158
|
+
- test/active_record/model/book.rb
|
146
159
|
- test/active_record/model/user.rb
|
147
|
-
- test/active_record/
|
148
|
-
- test/active_record/polymorphic_association_test.rb
|
160
|
+
- test/active_record/model/topic.rb
|
149
161
|
- test/active_record/second_level_cache_test.rb
|
150
|
-
- test/active_record/test_helper.rb
|
151
162
|
- test/record_marshal_test.rb
|
152
|
-
- test/require_test.rb
|
153
163
|
- test/test_helper.rb
|
164
|
+
has_rdoc:
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: e4f99ac985dd67cff8d2f43791e8c10d3b3dd16c
|
4
|
-
data.tar.gz: 01ba1af838f68cb8b0013668e17a42a8d1c8801e
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 5ae1f44bcc04c99d7c7a356c165eba029ffa8039a9e02270a5ef28132e66411c2fe5e5ac16d707c90831716e358a180d6d50f87032109c33c19197d3c035bbd5
|
7
|
-
data.tar.gz: 8276594d2e921ab5aad1d38b254e3ab1f0d6b21c5839c5f6c4c694a914baf1942704c5415330044122534ee603377b4ed6de5fa57b76a9492d6e51a8aaf5ce4c
|