Created
November 15, 2013 12:25
-
-
Save anonymous/7483564 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserSerializer < ActiveModel::Serializer | |
attributes :id, :name, :phone, :email, :balance, :children, :balance | |
def children # i need to add :children = true to JSON responce for each subuser who have @subuser.subordinates.any? | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if request.format.json? && params[:id] != nil && have_permissions?(User.find(params[:id])) | |
render json: @subusers, root: false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment