README.md in second_level_cache-2.0.0 vs README.md in second_level_cache-2.1.0.rc1
- old
+ new
@@ -77,11 +77,11 @@
```ruby
# this query will NOT be cached
User.select("id, name").find(1)
```
-Notice:
+## Notice
* SecondLevelCache cache by model name and id, so only find_one query will work.
* Only equal conditions query WILL get cache; and SQL string query like `User.where("name = 'Hooopo'").find(1)` WILL NOT work.
* SecondLevelCache sync cache after transaction commit:
@@ -97,9 +97,15 @@
ActiveRecord::Base.transaction do
user.save
account.save
end # <- Cache write
Rails.logger.info "info"
+```
+
+* If you are using SecondLevelCache with database_cleaner, you should set cleaning strategy to `:truncation`:
+
+```ruby
+DatabaseCleaner.strategy = :truncation
```
## Configure
In production env, we recommend to use [Dalli](https://github.com/mperham/dalli) as Rails cache store.