gearheads
/
mastodon
Archived
2
0
Fork 0

Need to disable caching again due to bug in Rabl

gh/stable
Eugen Rochko 2016-11-03 13:59:31 +01:00
parent 0160d1d9b5
commit 562044f36a
5 changed files with 12 additions and 15 deletions

View File

@ -10,9 +10,8 @@ class Api::V1::StatusesController < ApiController
def context
@status = Status.find(params[:id])
@ancestors = @status.ancestors
@descendants = @status.descendants
set_maps([@status] + @ancestors + @descendants)
@context = OpenStruct.new({ ancestors: @status.ancestors, descendants: @status.descendants })
set_maps([@status] + @context[:ancestors] + @context[:descendants])
end
def create

View File

@ -1,4 +1,5 @@
object @account
cache false
attribute :id
node(:following) { |account| @following[account.id] || false }
node(:followed_by) { |account| @followed_by[account.id] || false }

View File

@ -1,5 +1,5 @@
object @account
cache @account
cache false
attributes :id, :username, :acct, :display_name, :note

View File

@ -1,13 +1,10 @@
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

View File

@ -1,5 +1,5 @@
object @status
cache @status
cache false
extends 'api/v1/statuses/_show'