metamaps--metamaps/app/serializers/api/v2/mapping_serializer.rb
Connor Turland fb12c7e202 Track everything we need to reconstruct maps (#984)
* feature/more.events

* keep mapping.user as the creator

* cleanup cruft and include slack notifs

* capture topic and synapse updates, store the old values

* avoid the mapping gets deleted problem

* include an indicator of which values changed

* style cleanup

* remove the hack in favor of a legit way

* updated schema file
2016-12-16 16:51:52 -05:00

27 lines
571 B
Ruby

# frozen_string_literal: true
module Api
module V2
class MappingSerializer < ApplicationSerializer
attributes :id,
:created_at,
:updated_at,
:mappable_id,
:mappable_type
attribute :xloc, if: -> { object.mappable_type == 'Topic' }
attribute :yloc, if: -> { object.mappable_type == 'Topic' }
def self.embeddable
{
user: {},
updated_by: {},
map: {}
}
end
class_eval do
embed_dat
end
end
end
end