act_as_cached 0.0.3 → 0.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<tt>ActAsCached</tt> provides a lightweight second level cache.
|
10
10
|
|
11
|
-
## Supports
|
11
|
+
## Supports
|
12
12
|
|
13
13
|
* ActiveRecord associations
|
14
14
|
* ActtiveRecord::FinderMethods (primary key only)
|
@@ -56,6 +56,7 @@ Topic.find(:first).comments.find(1).user
|
|
56
56
|
Topic.find(:first)
|
57
57
|
=> #<Topic id: 1 ,title: 'foo'>
|
58
58
|
Comment.find(1)
|
59
|
+
# Comment Load (0.4ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`id` = 1 LIMIT 1
|
59
60
|
=> #<Comment id: 1, content: "xxxx">
|
60
61
|
Comment.find(1).user
|
61
62
|
=> #<User id: 1, name: 'foo'>
|
@@ -102,7 +103,8 @@ end
|
|
102
103
|
|
103
104
|
## Tips
|
104
105
|
|
105
|
-
* Currently not support <tt>ActiveRecord::Relation#find</tt> , If you wrote the `default_scope` in your class, cache won't be
|
106
|
+
* Currently not support <tt>ActiveRecord::Relation#find</tt> , If you wrote the `default_scope` in your class, cache won't be enabled.
|
107
|
+
* Be aware of [skipping-callbacks](http://edgeguides.rubyonrails.org/active_record_callbacks.html#skipping-callbacks) while using it.
|
106
108
|
|
107
109
|
----------------------
|
108
110
|
|
data/lib/act_as_cached.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
require 'act_as_cached/configurable'
|
2
1
|
require 'active_support/dependencies/autoload'
|
2
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
3
|
+
require 'act_as_cached/configurable'
|
3
4
|
module ActAsCached
|
4
5
|
extend Configurable
|
5
6
|
|
@@ -8,9 +9,5 @@ module ActAsCached
|
|
8
9
|
autoload :Mixin
|
9
10
|
autoload :Helpers
|
10
11
|
autoload :ActiveRecord
|
11
|
-
|
12
|
-
module ActiveRecord
|
13
|
-
autoload :Actobserver
|
14
|
-
end
|
15
12
|
end
|
16
13
|
require 'act_as_cached/rails' if defined?(::Rails::Engine)
|
data/lib/act_as_cached/mixin.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: act_as_cached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.3
|
4
|
+
version: 0.0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|