fix some errors with controllers/serializers

This commit is contained in:
Devin Howard 2016-07-01 15:18:38 +08:00
parent 2ffd62674d
commit dcd3cc6e78
6 changed files with 1 additions and 6 deletions

View file

@ -175,7 +175,7 @@ class MainController < ApplicationController
end end
#limit to 5 results #limit to 5 results
@synapses = @synapses.slice(0,5) @synapses = @synapses.to_a.slice(0,5)
render json: autocomplete_synapse_array_json(@synapses) render json: autocomplete_synapse_array_json(@synapses)
end end

View file

@ -1,5 +1,4 @@
class EventSerializer < ActiveModel::Serializer class EventSerializer < ActiveModel::Serializer
embed :ids, include: true
attributes :id, :sequence_id, :kind, :map_id, :created_at attributes :id, :sequence_id, :kind, :map_id, :created_at
has_one :actor, serializer: NewUserSerializer, root: 'users' has_one :actor, serializer: NewUserSerializer, root: 'users'

View file

@ -1,5 +1,4 @@
class NewMapSerializer < ActiveModel::Serializer class NewMapSerializer < ActiveModel::Serializer
embed :ids, include: true
attributes :id, attributes :id,
:name, :name,
:desc, :desc,

View file

@ -1,5 +1,4 @@
class NewMappingSerializer < ActiveModel::Serializer class NewMappingSerializer < ActiveModel::Serializer
embed :ids, include: true
attributes :id, attributes :id,
:xloc, :xloc,
:yloc, :yloc,

View file

@ -1,5 +1,4 @@
class NewSynapseSerializer < ActiveModel::Serializer class NewSynapseSerializer < ActiveModel::Serializer
embed :ids, include: true
attributes :id, attributes :id,
:desc, :desc,
:category, :category,

View file

@ -1,5 +1,4 @@
class NewTopicSerializer < ActiveModel::Serializer class NewTopicSerializer < ActiveModel::Serializer
embed :ids, include: true
attributes :id, attributes :id,
:name, :name,
:desc, :desc,