2016-09-24 03:00:46 +00:00
|
|
|
# frozen_string_literal: true
|
2016-09-21 17:22:40 +00:00
|
|
|
module Api
|
|
|
|
module V2
|
|
|
|
class MapSerializer < ApplicationSerializer
|
|
|
|
attributes :id,
|
2016-09-24 03:00:46 +00:00
|
|
|
:name,
|
|
|
|
:desc,
|
|
|
|
:permission,
|
|
|
|
:screenshot,
|
2016-10-05 14:36:03 +00:00
|
|
|
:starred,
|
2016-09-24 03:00:46 +00:00
|
|
|
:created_at,
|
|
|
|
:updated_at
|
2016-09-21 17:22:40 +00:00
|
|
|
|
2016-10-05 14:36:03 +00:00
|
|
|
def starred
|
|
|
|
object.starred_by_user?(scope[:current_user])
|
|
|
|
end
|
|
|
|
|
2016-09-21 17:22:40 +00:00
|
|
|
def self.embeddable
|
|
|
|
{
|
|
|
|
user: {},
|
|
|
|
topics: {},
|
|
|
|
synapses: {},
|
|
|
|
mappings: {},
|
|
|
|
contributors: { serializer: UserSerializer },
|
|
|
|
collaborators: { serializer: UserSerializer }
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2016-09-24 03:00:46 +00:00
|
|
|
class_eval do
|
2016-09-21 17:22:40 +00:00
|
|
|
embed_dat
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|