From dcd3cc6e787051bc6d55dd6f1270120c0087a546 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Fri, 1 Jul 2016 15:18:38 +0800 Subject: [PATCH] fix some errors with controllers/serializers --- app/controllers/main_controller.rb | 2 +- app/serializers/event_serializer.rb | 1 - app/serializers/new_map_serializer.rb | 1 - app/serializers/new_mapping_serializer.rb | 1 - app/serializers/new_synapse_serializer.rb | 1 - app/serializers/new_topic_serializer.rb | 1 - 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/main_controller.rb b/app/controllers/main_controller.rb index 87264c4c..7382b34a 100644 --- a/app/controllers/main_controller.rb +++ b/app/controllers/main_controller.rb @@ -175,7 +175,7 @@ class MainController < ApplicationController end #limit to 5 results - @synapses = @synapses.slice(0,5) + @synapses = @synapses.to_a.slice(0,5) render json: autocomplete_synapse_array_json(@synapses) end diff --git a/app/serializers/event_serializer.rb b/app/serializers/event_serializer.rb index 0e87cd44..723768a7 100644 --- a/app/serializers/event_serializer.rb +++ b/app/serializers/event_serializer.rb @@ -1,5 +1,4 @@ class EventSerializer < ActiveModel::Serializer - embed :ids, include: true attributes :id, :sequence_id, :kind, :map_id, :created_at has_one :actor, serializer: NewUserSerializer, root: 'users' diff --git a/app/serializers/new_map_serializer.rb b/app/serializers/new_map_serializer.rb index 3c56f82f..4139f4c6 100644 --- a/app/serializers/new_map_serializer.rb +++ b/app/serializers/new_map_serializer.rb @@ -1,5 +1,4 @@ class NewMapSerializer < ActiveModel::Serializer - embed :ids, include: true attributes :id, :name, :desc, diff --git a/app/serializers/new_mapping_serializer.rb b/app/serializers/new_mapping_serializer.rb index 4e65e161..90c4c66c 100644 --- a/app/serializers/new_mapping_serializer.rb +++ b/app/serializers/new_mapping_serializer.rb @@ -1,5 +1,4 @@ class NewMappingSerializer < ActiveModel::Serializer - embed :ids, include: true attributes :id, :xloc, :yloc, diff --git a/app/serializers/new_synapse_serializer.rb b/app/serializers/new_synapse_serializer.rb index b145d605..dd6fd6b5 100644 --- a/app/serializers/new_synapse_serializer.rb +++ b/app/serializers/new_synapse_serializer.rb @@ -1,5 +1,4 @@ class NewSynapseSerializer < ActiveModel::Serializer - embed :ids, include: true attributes :id, :desc, :category, diff --git a/app/serializers/new_topic_serializer.rb b/app/serializers/new_topic_serializer.rb index cdbbedf9..f9a1b962 100644 --- a/app/serializers/new_topic_serializer.rb +++ b/app/serializers/new_topic_serializer.rb @@ -1,5 +1,4 @@ class NewTopicSerializer < ActiveModel::Serializer - embed :ids, include: true attributes :id, :name, :desc,