-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Model class cache key #3
Conversation
|
||
context 'when no record exist' do | ||
before{ User.destroy_all } | ||
it{ subject; subject.must_equal "User-0" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the subject;
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ups didn't see that
# SELECT MAX(`posts`.`cached_at`) AS max_id FROM `posts` | ||
# => "Post-1377768216" | ||
|
||
You can use this inside your cachin syntax when you are monitoring if model was changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cachin typo. Also this does not read well. Can you change it too something like 'You can use the model to generate cache keys'
good to go ? |
thanks |
Provides class method
cache_key
for model classThis can be used as parameter for Rails.cache.fetch