-
Notifications
You must be signed in to change notification settings - Fork 12
Fragment caching #8
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
Conversation
spec/renderer_spec.rb
Outdated
| @id.to_s | ||
| end | ||
|
|
||
| def jsonapi_cache_key(options = {}) |
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.
Unused method argument - options. If it's necessary, use _ or _options as an argument name to indicate that it won't be used. You can also write as jsonapi_cache_key(*) if you want the method to accept any arguments but don't care about them.
spec/renderer_spec.rb
Outdated
| @id.to_s | ||
| end | ||
|
|
||
| def jsonapi_cache_key(options = {}) |
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.
Unused method argument - options. If it's necessary, use _ or _options as an argument name to indicate that it won't be used. You can also write as jsonapi_cache_key(*) if you want the method to accept any arguments but don't care about them.
| @include = include | ||
| @fields = fields | ||
|
|
||
|
|
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.
Extra blank line detected.
|
|
||
| def fetch_multi(keys, &block) | ||
| keys.each_with_object({}) do |k, h| | ||
| @cache[k] = block.call(k) unless @cache.key?(k) |
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.
Use yield instead of block.call.
| @@ -1,19 +1,33 @@ | |||
| require 'set' | |||
|
|
|||
| class Cache | |||
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.
Missing top-level class documentation comment.
Needs benchmark.
Closes #9