Fix #50 - Order ancestors/descendants by tree path
This commit is contained in:
parent
d709151781
commit
c0e9603c92
3 changed files with 12 additions and 6 deletions
|
@ -8,8 +8,8 @@ class Api::StatusesController < ApiController
|
|||
|
||||
def context
|
||||
@status = Status.find(params[:id])
|
||||
@ancestors = @status.ancestors.with_includes.with_counters.to_a
|
||||
@descendants = @status.descendants.with_includes.with_counters.to_a
|
||||
@ancestors = @status.ancestors
|
||||
@descendants = @status.descendants
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
@ -9,8 +9,8 @@ class StreamEntriesController < ApplicationController
|
|||
@type = @stream_entry.activity_type.downcase
|
||||
|
||||
if @stream_entry.activity_type == 'Status'
|
||||
@ancestors = @stream_entry.activity.ancestors.with_includes.with_counters
|
||||
@descendants = @stream_entry.activity.descendants.with_includes.with_counters
|
||||
@ancestors = @stream_entry.activity.ancestors
|
||||
@descendants = @stream_entry.activity.descendants
|
||||
|
||||
if user_signed_in?
|
||||
status_ids = [@stream_entry.activity_id] + @ancestors.map { |s| s.id } + @descendants.map { |s| s.id }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue