Need to disable caching again due to bug in Rabl
parent
71836838dd
commit
695f62e49e
|
@ -10,9 +10,8 @@ class Api::V1::StatusesController < ApiController
|
||||||
|
|
||||||
def context
|
def context
|
||||||
@status = Status.find(params[:id])
|
@status = Status.find(params[:id])
|
||||||
@ancestors = @status.ancestors
|
@context = OpenStruct.new({ ancestors: @status.ancestors, descendants: @status.descendants })
|
||||||
@descendants = @status.descendants
|
set_maps([@status] + @context[:ancestors] + @context[:descendants])
|
||||||
set_maps([@status] + @ancestors + @descendants)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
object @account
|
object @account
|
||||||
|
cache false
|
||||||
attribute :id
|
attribute :id
|
||||||
node(:following) { |account| @following[account.id] || false }
|
node(:following) { |account| @following[account.id] || false }
|
||||||
node(:followed_by) { |account| @followed_by[account.id] || false }
|
node(:followed_by) { |account| @followed_by[account.id] || false }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
object @account
|
object @account
|
||||||
cache @account
|
cache false
|
||||||
|
|
||||||
attributes :id, :username, :acct, :display_name, :note
|
attributes :id, :username, :acct, :display_name, :note
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
object false
|
object @context
|
||||||
|
cache false
|
||||||
|
|
||||||
node :ancestors do
|
node :ancestors do |context|
|
||||||
@ancestors.map do |status|
|
partial 'api/v1/statuses/index', object: context.ancestors
|
||||||
partial('api/v1/statuses/show', object: status)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
node :descendants do
|
node :descendants do |context|
|
||||||
@descendants.map do |status|
|
partial 'api/v1/statuses/index', object: context.descendants
|
||||||
partial('api/v1/statuses/show', object: status)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
object @status
|
object @status
|
||||||
cache @status
|
cache false
|
||||||
|
|
||||||
extends 'api/v1/statuses/_show'
|
extends 'api/v1/statuses/_show'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue