aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/CHANGELOG.md
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2018-07-01 12:42:18 +0200
committerKasper Timm Hansen <kaspth@gmail.com>2018-07-01 12:46:15 +0200
commit969577d960cd7e2d0a421af4a987f56894c3b229 (patch)
treeea6aa0f608aa255e0e49a6d0970baedf6dca92e5 /activesupport/CHANGELOG.md
parentf666fb58a3d7b56461d9aac04411022aaa86c0c7 (diff)
downloadrails-969577d960cd7e2d0a421af4a987f56894c3b229.tar.gz
rails-969577d960cd7e2d0a421af4a987f56894c3b229.tar.bz2
rails-969577d960cd7e2d0a421af4a987f56894c3b229.zip
Refactor #33254.
Firstly, increment and decrement shouldn't care about the particulars of key expiry. They should only know that they have to pass that responsibility on to somewhere else. Secondly, it moves the key normalization back inside the instrumentation like it was originally. I think that matches the original design intention or at the very least it lets users catch haywire key truncation. Thirdly, it moves the changelog entry to the top of the file, where new entries go. I couldn't understand what the entry was saying so I tried to rewrite it.
Diffstat (limited to 'activesupport/CHANGELOG.md')
-rw-r--r--activesupport/CHANGELOG.md21
1 files changed, 10 insertions, 11 deletions
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index 8031d351a9..24ad72c45d 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -1,3 +1,13 @@
+* RedisCacheStore: support key expiry in increment/decrement.
+
+ Pass `:expires_in` to `#increment` and `#decrement` to set a Redis EXPIRE on the key.
+
+ If the key is already set to expire, RedisCacheStore won't extend its expiry.
+
+ Rails.cache.increment("some_key", 1, expires_in: 2.minutes)
+
+ *Jason Lee*
+
* Allow Range#=== and Range#cover? on Range
`Range#cover?` can now accept a range argument like `Range#include?` and
@@ -131,16 +141,5 @@
*Eileen M. Uchitelle*, *Aaron Patterson*
-* RedisCacheStore: Support expiring counters.
- Pass `expires_in: [seconds]` to `#increment` and `#decrement` options
- to set the Redis EXPIRE if the counter doesn't exist.
- If the counter exists, Redis doesn't extend its expiry when it's exist.
-
- ```
- Rails.cache.increment("my_counter", 1, expires_in: 2.minutes)
- ```
-
- *Jason Lee*
-
Please check [5-2-stable](https://github.com/rails/rails/blob/5-2-stable/activesupport/CHANGELOG.md) for previous changes.