You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is that when topics/base is being extended in topics/index, @topic inside topics/base is not set correctly (it is nil, not sure if it's by design).
Therefore, when Rabl try to generate a cache key from ['v1', @topic], it ends up generating one from ['v1', nil], and hence the result from the first object is being reused for all the @topics.
This seems to work, but it's probably considered a hack:
In topics/base.json.rabl:
object@topiccache['v1',@_data_object]attribute:id
The text was updated successfully, but these errors were encountered:
Right, I don't see why @DKFUNG's solution won't work, as root_object simply returns @_data_object. I think I was just a little confused by the documentation when I first got started. Upon re-examining the documentation, it does in fact cover root_object in the last example.
However, the first collection example simply users cache @user, and based on my description in the ticket, that seems to be incorrect? I can't verify this for the moment, so if someone can whip up a simple test case for this it'd be nice (otherwise I'll get to it when I have time).
The documentation seems to suggest that I can do this:
In topics/index.json.rabl:
In topics/base.json.rabl:
Actual result:
The reason is that when topics/base is being extended in topics/index, @topic inside topics/base is not set correctly (it is nil, not sure if it's by design).
Therefore, when Rabl try to generate a cache key from
['v1', @topic]
, it ends up generating one from['v1', nil]
, and hence the result from the first object is being reused for all the @topics.This seems to work, but it's probably considered a hack:
In topics/base.json.rabl:
The text was updated successfully, but these errors were encountered: