-
-
Save exlee/38eed8b742d0eaaf3a00169965f93d29 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
def show | |
authorize! :manage, :all | |
# Behold Teh Pyramid Of Doom. | |
# | |
# | |
# ' | |
# /=\\ | |
# /===\ \ | |
# /=====\' \ <== Teh Pyramid | |
# /=======\'' \ Of Doom | |
# /=========\ ' '\ | |
# /===========\'' \ | |
# /=============\ ' ' \ | |
# /===============\ '' \ | |
# /=================\' ' ' ' \ | |
# /===================\' ' ' ' \ | |
# /=====================\' ' ' ' \ | |
# /=======================\ ' ' / | |
# /=========================\ ' / | |
# /===========================\' / | |
# /=============================\/ | |
# | |
# Actually this below is not funny, but | |
# it's the only way multi-level includes can be introduced. | |
user=User.find(params[:id]) | |
us = user.as_json( | |
:methods => [:owned_groups, :organization_group_id, :organization_permissions], | |
:include => { | |
:groups => { | |
:include => { | |
:permissions => { | |
:methods => [:type, :description] | |
} | |
} | |
} | |
} | |
) | |
us[:school_meta] = get_user_school_meta(user) | |
render :json => us | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment