attribute_cache 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/attribute_cache.rb +7 -0
- data/lib/attribute_cache/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a461cfe2ed010a9b5934d7f3638d7506342e791b1fa6e6fca2e26d16d16aaca3
|
4
|
+
data.tar.gz: 379500bd4bf3b841a5e5f948bb7fbdf48129bf4218395e6f636774b5c2c134a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2b9e15cffd9de958d4985cb00ddf1c0d26108cdd6024020b391d47f411c789769192225084ac3573e075485dc8b283b3451a28f4a0ec69f7632209e720afa97
|
7
|
+
data.tar.gz: 73201dbe32e5a13b3a4542311450a40514dad1750ef9727724d22f246b18cf5994c0af74e12206c91a44def83c798c4b62355e1e89d1acfb57cc02a9d4395234
|
data/lib/attribute_cache.rb
CHANGED
@@ -59,6 +59,13 @@ module AttributeCache
|
|
59
59
|
attr_cache.value(self, save: save, keep_blanks: keep_blanks)
|
60
60
|
end
|
61
61
|
end
|
62
|
+
|
63
|
+
def self.attribute_store(name, options = {}, &block)
|
64
|
+
options.default! :cache_on_create, true
|
65
|
+
options.default! :attribute_prefix, 'stored'
|
66
|
+
|
67
|
+
attribute_cache(name, options, &block)
|
68
|
+
end
|
62
69
|
end
|
63
70
|
|
64
71
|
private
|