Skip to content

Instantly share code, notes, and snippets.

@exlee
Created November 20, 2017 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exlee/38eed8b742d0eaaf3a00169965f93d29 to your computer and use it in GitHub Desktop.
Save exlee/38eed8b742d0eaaf3a00169965f93d29 to your computer and use it in GitHub Desktop.
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