Skip to content
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

Results caching with object set to false #89

Open
shmeltex opened this issue Sep 8, 2017 · 0 comments
Open

Results caching with object set to false #89

shmeltex opened this issue Sep 8, 2017 · 0 comments

Comments

@shmeltex
Copy link
Contributor

shmeltex commented Sep 8, 2017

I'm trying to figure out how to use results caching with following rabl:

object false

child :employees => :data do
    extends "employees/_single"
end

node(:success) { true }
node(:total) { employees.size }

If I just add cache then run into error ActionView::Template::Error: undefined method 'cache_key' for nil:NilClass

If add cache with a block

object false

cache { |_| "#{ employees.cache_key }" }

child :employees => :data do
  extends "employees/_single"
end

node(:success) { true }
node(:total) { employees.size }

then it can't resolve employees: ActionView::Template::Error: undefined local variable or method 'employees' for RablRails::Renderers::JSON:Module

What's the right approach here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant