Required changes for consistent controller & feature results

This commit is contained in:
James Mason 2018-09-29 15:56:12 -07:00
parent 94838f932a
commit a20dcc6125
No known key found for this signature in database
GPG key ID: 1B3951886C449023
3 changed files with 6 additions and 2 deletions

View file

@ -18,7 +18,10 @@ module Api
end
users = users.where(event_users: {event_role: :speaker}).uniq
render json: users, each_serializer: SpeakerSerializer, callback: params['callback']
render json: users,
each_serializer: SpeakerSerializer,
callback: params['callback'],
root: 'speakers'
end
end
end

View file

@ -3,7 +3,7 @@
#
# Needed in order to add the API version number to the conferences array
#
class ConferencesArraySerializer < ActiveModel::ArraySerializer
class ConferencesArraySerializer < ActiveModel::Serializer::CollectionSerializer
def as_json(*args)
json = super
json.merge!(version: 1)

View file

@ -0,0 +1 @@
ActiveModelSerializers.config.adapter = :json