Skip to content
Snippets Groups Projects
Commit 562044f3 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Need to disable caching again due to bug in Rabl

parent 0160d1d9
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,9 @@ class Api::V1::StatusesController < ApiController
end
def context
@status = Status.find(params[:id])
@ancestors = @status.ancestors
@descendants = @status.descendants
set_maps([@status] + @ancestors + @descendants)
@status = Status.find(params[:id])
@context = OpenStruct.new({ ancestors: @status.ancestors, descendants: @status.descendants })
set_maps([@status] + @context[:ancestors] + @context[:descendants])
end
def create
......
object @account
cache false
attribute :id
node(:following) { |account| @following[account.id] || false }
node(:followed_by) { |account| @followed_by[account.id] || false }
......
object @account
cache @account
cache false
attributes :id, :username, :acct, :display_name, :note
......
object false
object @context
cache false
node :ancestors do
@ancestors.map do |status|
partial('api/v1/statuses/show', object: status)
end
node :ancestors do |context|
partial 'api/v1/statuses/index', object: context.ancestors
end
node :descendants do
@descendants.map do |status|
partial('api/v1/statuses/show', object: status)
end
node :descendants do |context|
partial 'api/v1/statuses/index', object: context.descendants
end
object @status
cache @status
cache false
extends 'api/v1/statuses/_show'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment