class User < ActiveResource::Base
cached_resource
class teachers < SimpleDelegator
attr_accessor :teacher_id
def initialize(attributes = {}, _persisted = true)
@teacher_id = attributes['teacher_id']
super(User.find(@teacher_id))
end
end
end
I am trying to cache user resources.
/users/:user_id
Whenever i am calling /users/:user_id endpoint it gives me error singleton can't be dumped at line super(User.find(@teacher_id))
Please let me know if any other info is required. I am stucked with it, please help me out.
Using cached_resource gem for caching active resources.
User model
I am trying to cache user resources.
/users/:user_id
Whenever i am calling /users/:user_id endpoint it gives me error singleton can't be dumped at line
super(User.find(@teacher_id))
Please let me know if any other info is required. I am stucked with it, please help me out.