redid so they won't interfere
This commit is contained in:
parent
450db5eb8d
commit
77d39d6649
6 changed files with 18 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
|||
class MapSerializer < ActiveModel::Serializer
|
||||
class NewMapSerializer < ActiveModel::Serializer
|
||||
embed :ids, include: true
|
||||
attributes :id,
|
||||
:name,
|
||||
|
@ -8,10 +8,10 @@ class MapSerializer < ActiveModel::Serializer
|
|||
:created_at,
|
||||
:updated_at
|
||||
|
||||
has_many :topics
|
||||
has_many :synapses
|
||||
has_many :mappings
|
||||
has_many :contributors, root: :users
|
||||
has_many :topics, serializer: NewTopicSerializer
|
||||
has_many :synapses, serializer: NewSynapseSerializer
|
||||
has_many :mappings, serializer: NewMappingSerializer
|
||||
has_many :contributors, root: :users, serializer: NewUserSerializer
|
||||
|
||||
#def filter(keys)
|
||||
# keys.delete(:outcome_author) unless object.outcome_author.present?
|
|
@ -1,13 +1,13 @@
|
|||
class MappingSerializer < ActiveModel::Serializer
|
||||
class NewMappingSerializer < ActiveModel::Serializer
|
||||
embed :ids, include: true
|
||||
attributes :id,
|
||||
:xloc,
|
||||
:yloc,
|
||||
:created_at,
|
||||
:updated_at
|
||||
has_one :user
|
||||
has_one :map
|
||||
has_one :mappable, polymorphic: true
|
||||
has_one :user, serializer: NewUserSerializer
|
||||
has_one :map, serializer: NewMapSerializer
|
||||
has_one :mappable, polymorphic: true ##?
|
||||
|
||||
def filter(keys)
|
||||
keys.delete(:xloc) unless object.mappable_type == "Topic"
|
|
@ -1,4 +1,4 @@
|
|||
class MetacodeSerializer < ActiveModel::Serializer
|
||||
class NewMetacodeSerializer < ActiveModel::Serializer
|
||||
attributes :id,
|
||||
:name,
|
||||
:manual_icon,
|
|
@ -1,4 +1,4 @@
|
|||
class SynapseSerializer < ActiveModel::Serializer
|
||||
class NewSynapseSerializer < ActiveModel::Serializer
|
||||
embed :ids, include: true
|
||||
attributes :id,
|
||||
:desc,
|
||||
|
@ -8,9 +8,9 @@ class SynapseSerializer < ActiveModel::Serializer
|
|||
:created_at,
|
||||
:updated_at
|
||||
|
||||
has_one :topic1, root: :topics
|
||||
has_one :topic2, root: :topics
|
||||
has_one :user
|
||||
has_one :topic1, root: :topics, serializer: NewTopicSerializer
|
||||
has_one :topic2, root: :topics, serializer: NewTopicSerializer
|
||||
has_one :user, serializer: NewUserSerializer
|
||||
|
||||
#def filter(keys)
|
||||
# keys.delete(:outcome_author) unless object.outcome_author.present?
|
|
@ -1,4 +1,4 @@
|
|||
class TopicSerializer < ActiveModel::Serializer
|
||||
class NewTopicSerializer < ActiveModel::Serializer
|
||||
embed :ids, include: true
|
||||
attributes :id,
|
||||
:name,
|
||||
|
@ -8,8 +8,8 @@ class TopicSerializer < ActiveModel::Serializer
|
|||
:created_at,
|
||||
:updated_at
|
||||
|
||||
has_one :user
|
||||
has_one :metacode
|
||||
has_one :user, serializer: NewUserSerializer
|
||||
has_one :metacode, serializer: NewMetacodeSerializer
|
||||
|
||||
#def filter(keys)
|
||||
# keys.delete(:outcome_author) unless object.outcome_author.present?
|
|
@ -1,4 +1,4 @@
|
|||
class UserSerializer < ActiveModel::Serializer
|
||||
class NewUserSerializer < ActiveModel::Serializer
|
||||
attributes :id,
|
||||
:name,
|
||||
:avatar,
|
Loading…
Reference in a new issue