redid so they won't interfere

This commit is contained in:
Connor Turland 2016-03-12 09:48:07 +11:00
parent 450db5eb8d
commit 77d39d6649
6 changed files with 18 additions and 18 deletions

View file

@ -1,4 +1,4 @@
class MapSerializer < ActiveModel::Serializer class NewMapSerializer < ActiveModel::Serializer
embed :ids, include: true embed :ids, include: true
attributes :id, attributes :id,
:name, :name,
@ -8,10 +8,10 @@ class MapSerializer < ActiveModel::Serializer
:created_at, :created_at,
:updated_at :updated_at
has_many :topics has_many :topics, serializer: NewTopicSerializer
has_many :synapses has_many :synapses, serializer: NewSynapseSerializer
has_many :mappings has_many :mappings, serializer: NewMappingSerializer
has_many :contributors, root: :users has_many :contributors, root: :users, serializer: NewUserSerializer
#def filter(keys) #def filter(keys)
# keys.delete(:outcome_author) unless object.outcome_author.present? # keys.delete(:outcome_author) unless object.outcome_author.present?

View file

@ -1,13 +1,13 @@
class MappingSerializer < ActiveModel::Serializer class NewMappingSerializer < ActiveModel::Serializer
embed :ids, include: true embed :ids, include: true
attributes :id, attributes :id,
:xloc, :xloc,
:yloc, :yloc,
:created_at, :created_at,
:updated_at :updated_at
has_one :user has_one :user, serializer: NewUserSerializer
has_one :map has_one :map, serializer: NewMapSerializer
has_one :mappable, polymorphic: true has_one :mappable, polymorphic: true ##?
def filter(keys) def filter(keys)
keys.delete(:xloc) unless object.mappable_type == "Topic" keys.delete(:xloc) unless object.mappable_type == "Topic"

View file

@ -1,4 +1,4 @@
class MetacodeSerializer < ActiveModel::Serializer class NewMetacodeSerializer < ActiveModel::Serializer
attributes :id, attributes :id,
:name, :name,
:manual_icon, :manual_icon,

View file

@ -1,4 +1,4 @@
class SynapseSerializer < ActiveModel::Serializer class NewSynapseSerializer < ActiveModel::Serializer
embed :ids, include: true embed :ids, include: true
attributes :id, attributes :id,
:desc, :desc,
@ -8,9 +8,9 @@ class SynapseSerializer < ActiveModel::Serializer
:created_at, :created_at,
:updated_at :updated_at
has_one :topic1, root: :topics has_one :topic1, root: :topics, serializer: NewTopicSerializer
has_one :topic2, root: :topics has_one :topic2, root: :topics, serializer: NewTopicSerializer
has_one :user has_one :user, serializer: NewUserSerializer
#def filter(keys) #def filter(keys)
# keys.delete(:outcome_author) unless object.outcome_author.present? # keys.delete(:outcome_author) unless object.outcome_author.present?

View file

@ -1,4 +1,4 @@
class TopicSerializer < ActiveModel::Serializer class NewTopicSerializer < ActiveModel::Serializer
embed :ids, include: true embed :ids, include: true
attributes :id, attributes :id,
:name, :name,
@ -8,8 +8,8 @@ class TopicSerializer < ActiveModel::Serializer
:created_at, :created_at,
:updated_at :updated_at
has_one :user has_one :user, serializer: NewUserSerializer
has_one :metacode has_one :metacode, serializer: NewMetacodeSerializer
#def filter(keys) #def filter(keys)
# keys.delete(:outcome_author) unless object.outcome_author.present? # keys.delete(:outcome_author) unless object.outcome_author.present?

View file

@ -1,4 +1,4 @@
class UserSerializer < ActiveModel::Serializer class NewUserSerializer < ActiveModel::Serializer
attributes :id, attributes :id,
:name, :name,
:avatar, :avatar,