Commit 3c43f4b3e51f2be097d1dbd88ac0d8b973119f95

Authored by Leandro Santos
Committed by Rodrigo Souto
1 parent 6138ba4d

adding root clause in entities return

Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
lib/api/entities.rb
1 1 module API
2 2 module Entities
3 3 class Article < Grape::Entity
  4 + root 'articles', 'article'
4 5 expose :id, :name, :body, :created_at
5 6  
6 7 expose :author do |article, options|
... ... @@ -17,6 +18,7 @@ module API
17 18 end
18 19  
19 20 class Comment < Grape::Entity
  21 + root 'comments', 'comment'
20 22 expose :body, :title, :created_at, :id
21 23  
22 24 expose :author do |comment, options|
... ... @@ -33,6 +35,7 @@ module API
33 35 end
34 36  
35 37 class User < Grape::Entity
  38 + root 'users', 'user'
36 39 expose :login
37 40 end
38 41  
... ...