Skip to content

Commit 3a130c9

Browse files
committed
Update README.md
1 parent e1599fd commit 3a130c9

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ To enable caching for an attribute, simply call one of the `cache_*` methods in
6666
- `cache_hash` - Caches a hash structure.
6767
- `cache_boolean` - Caches a boolean value.
6868

69+
#### Prerequisite
70+
71+
In order to use the aforementioned methods in your class, you need to do two things:
72+
- include `ActiveModel::Caching`
73+
- your class must implement the `id` method.
74+
6975
#### Example
7076

7177
Here’s how you might define a model with various cached attributes:

0 commit comments

Comments
 (0)