Required changes for consistent controller & feature results
This commit is contained in:
parent
c3e6f02b46
commit
ac3be77219
3 changed files with 6 additions and 2 deletions
|
|
@ -18,7 +18,10 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
users = users.where(event_users: {event_role: :speaker}).uniq
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# Needed in order to add the API version number to the conferences array
|
# 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)
|
def as_json(*args)
|
||||||
json = super
|
json = super
|
||||||
json.merge!(version: 1)
|
json.merge!(version: 1)
|
||||||
|
|
|
||||||
1
config/initializers/serializer.rb
Normal file
1
config/initializers/serializer.rb
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
ActiveModelSerializers.config.adapter = :json
|
||||||
Loading…
Add table
Add a link
Reference in a new issue