messages weren't being displayed in order
This commit is contained in:
parent
26025d6ee9
commit
616dc9ed0e
1 changed files with 11 additions and 11 deletions
|
@ -63,7 +63,7 @@ class MapsController < ApplicationController
|
||||||
object = m.mappable
|
object = m.mappable
|
||||||
!object || (object.permission == "private" && (!authenticated? || (authenticated? && @current.id != object.user_id)))
|
!object || (object.permission == "private" && (!authenticated? || (authenticated? && @current.id != object.user_id)))
|
||||||
}
|
}
|
||||||
@allmessages = @map.messages
|
@allmessages = @map.messages.sort_by(&:created_at)
|
||||||
|
|
||||||
respond_with(@allmappers, @allmappings, @allsynapses, @alltopics, @allmessages, @map)
|
respond_with(@allmappers, @allmappings, @allsynapses, @alltopics, @allmessages, @map)
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ class MapsController < ApplicationController
|
||||||
@json['synapses'] = @allsynapses
|
@json['synapses'] = @allsynapses
|
||||||
@json['mappings'] = @allmappings
|
@json['mappings'] = @allmappings
|
||||||
@json['mappers'] = @allmappers
|
@json['mappers'] = @allmappers
|
||||||
@json['messages'] = @map.messages
|
@json['messages'] = @map.messages.sort_by(&:created_at)
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json { render json: @json }
|
format.json { render json: @json }
|
||||||
|
|
Loading…
Reference in a new issue