I am using awesome_nested_set gem in rails In my controller I want to return
if it is leaf object
[ Model.find(params[:id]) ] # self object in array
and if it is not leaf, then
Model.find(params[:id]).leaves # all the leaves of this object
What could be the best way to do so ?