cache_with_settings 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -4
- data/lib/cache_with_settings.rb +1 -1
- data/lib/cache_with_settings/configuration.rb +1 -1
- data/lib/cache_with_settings/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: 57ebed20eb0d765842ce7458b3c3132fa56e36ef83d8398420a214df29241ce6
|
4
|
+
data.tar.gz: 35d0952e1a8fe83be020898ea874cd398675a8d497a6ffa03df1f13f5cb6ee03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a203fd0b9e512b17cfddf6a78b9eb3ccccfd6c597cbd875d1b5e9af20fe00047a13f0daa893e5abe9425a6e80d93580fcaf7c891e92cddac8971f47bc8791258
|
7
|
+
data.tar.gz: f923131cc36b7b7c69ee337fadd72b26b731e787d8d55ead36fa06e43ceecbe11ebaf47e47890fa67c8751e242460ce022de73681958c128e03c8b1d16a13e1c
|
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
|
1
|
+
# CacheWithSettings
|
2
|
+
CacheWithSettings allows you to add any key to partial caching cache keys. This is useful if your website is multilingual or allows the user to choose a display currency.
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
[![Build Status](https://travis-ci.org/richardvenneman/cache_with_settings.svg?branch=master)](https://travis-ci.org/richardvenneman/cache_with_settings)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/cache_with_settings.svg)](https://badge.fury.io/rb/cache_with_settings)
|
5
6
|
|
6
7
|
## Problem & Solution
|
7
8
|
If you find yourself adding dynamic values, such as locales and currencies to your cache keys, this gem could be useful for you. Instead of:
|
@@ -25,7 +26,8 @@ After adding the gem to your Gemfile, configure CacheWithSettings in an initiali
|
|
25
26
|
|
26
27
|
```ruby
|
27
28
|
CacheWithSettings.configure do |config|
|
28
|
-
|
29
|
+
# Specify a proc that returns an array of strings
|
30
|
+
config.cache_keys = -> { [I18n.locale.to_s, MoneyRails.default_currency.to_s] }
|
29
31
|
end
|
30
32
|
```
|
31
33
|
|
data/lib/cache_with_settings.rb
CHANGED