small refactoring of as_json method
small refactoring of as_json method

with this change root has always one assignment

hanystudy/rails,kmcphillips/rails,rafaelfranca/omg-rails,ngpestelos/rails,notapatch/rails,iainbeeston/rails,assain/rails,Edouard-chin/rails,pschambacher/rails,illacceptanything/illacceptanything,yahonda/rails,Erol/rails,illacceptanything/illacceptanything,palkan/rails,arunagw/rails,vipulnsward/rails,illacceptanything/illacceptanything,sergey-alekseev/rails,tjschuck/rails,kmayer/rails,EmmaB/rails-1,riseshia/railsguides.kr,yawboakye/rails,deraru/rails,mathieujobin/reduced-rails-for-travis,eileencodes/rails,matrinox/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,MichaelSp/rails,yhirano55/rails,Envek/rails,MSP-Greg/rails,yasslab/railsguides.jp,bogdanvlviv/rails,shioyama/rails,betesh/rails,odedniv/rails,Erol/rails,esparta/rails,Spin42/rails,kmayer/rails,amoody2108/TechForJustice,vipulnsward/rails,MSP-Greg/rails,Edouard-chin/rails,baerjam/rails,maicher/rails,matrinox/rails,Stellenticket/rails,assain/rails,georgeclaghorn/rails,illacceptanything/illacceptanything,bogdanvlviv/rails,bolek/rails,utilum/rails,elfassy/rails,ledestin/rails,gavingmiller/rails,printercu/rails,xlymian/rails,voray/rails,88rabbit/newRails,bogdanvlviv/rails,notapatch/rails,rossta/rails,rails/rails,illacceptanything/illacceptanything,yahonda/rails,mathieujobin/reduced-rails-for-travis,kmcphillips/rails,richseviora/rails,kaspth/rails,mijoharas/rails,xlymian/rails,gfvcastro/rails,coreyward/rails,ledestin/rails,Sen-Zhang/rails,schuetzm/rails,aditya-kapoor/rails,Vasfed/rails,brchristian/rails,notapatch/rails,rossta/rails,ngpestelos/rails,koic/rails,joonyou/rails,untidy-hair/rails,repinel/rails,utilum/rails,kmcphillips/rails,koic/rails,fabianoleittes/rails,repinel/rails,lcreid/rails,coreyward/rails,flanger001/rails,mohitnatoo/rails,betesh/rails,georgeclaghorn/rails,sergey-alekseev/rails,odedniv/rails,Envek/rails,aditya-kapoor/rails,rails/rails,mohitnatoo/rails,kirs/rails-1,vassilevsky/rails,prathamesh-sonpatki/rails,EmmaB/rails-1,sealocal/rails,mtsmfm/rails,flanger001/rails,Envek/rails,mechanicles/rails,jeremy/rails,marklocklear/rails,yawboakye/rails,gfvcastro/rails,riseshia/railsguides.kr,kirs/rails-1,samphilipd/rails,travisofthenorth/rails,riseshia/railsguides.kr,riseshia/railsguides.kr,travisofthenorth/rails,flanger001/rails,yhirano55/rails,marklocklear/rails,tijwelch/rails,mechanicles/rails,yhirano55/rails,kachick/rails,iainbeeston/rails,untidy-hair/rails,pschambacher/rails,BlakeWilliams/rails,printercu/rails,alecspopa/rails,ledestin/rails,ttanimichi/rails,brchristian/rails,bradleypriest/rails,mtsmfm/rails,marklocklear/rails,starknx/rails,baerjam/rails,deraru/rails,yhirano55/rails,rbhitchcock/rails,pvalena/rails,kddeisz/rails,aditya-kapoor/rails,kddeisz/rails,elfassy/rails,eileencodes/rails,Vasfed/rails,ngpestelos/rails,arjes/rails,maicher/rails,arunagw/rails,Vasfed/rails,palkan/rails,gavingmiller/rails,kenta-s/rails,shioyama/rails,gfvcastro/rails,kamipo/rails,sergey-alekseev/rails,matrinox/rails,lucasmazza/rails,sealocal/rails,baerjam/rails,illacceptanything/illacceptanything,vassilevsky/rails,jeremy/rails,koic/rails,kenta-s/rails,georgeclaghorn/rails,deraru/rails,gavingmiller/rails,odedniv/rails,arunagw/rails,yahonda/rails,repinel/rails,rafaelfranca/omg-rails,prathamesh-sonpatki/rails,voray/rails,illacceptanything/illacceptanything,tjschuck/rails,samphilipd/rails,bogdanvlviv/rails,vassilevsky/rails,pschambacher/rails,rails/rails,Spin42/rails,untidy-hair/rails,bradleypriest/rails,coreyward/rails,flanger001/rails,pvalena/rails,felipecvo/rails,assain/rails,joonyou/rails,Spin42/rails,kamipo/rails,stefanmb/rails,Envek/rails,printercu/rails,mtsmfm/railstest,rbhitchcock/rails,schuetzm/rails,ttanimichi/rails,assain/rails,fabianoleittes/rails,kmayer/rails,richseviora/rails,bradleypriest/rails,tgxworld/rails,pvalena/rails,BlakeWilliams/rails,MichaelSp/rails,betesh/rails,illacceptanything/illacceptanything,mijoharas/rails,yasslab/railsguides.jp,MSP-Greg/rails,EmmaB/rails-1,eileencodes/rails,tijwelch/rails,hanystudy/rails,vipulnsward/rails,rbhitchcock/rails,shioyama/rails,gauravtiwari/rails,mohitnatoo/rails,deraru/rails,travisofthenorth/rails,yasslab/railsguides.jp,mtsmfm/railstest,yalab/rails,kddeisz/rails,Edouard-chin/rails,fabianoleittes/rails,notapatch/rails,kamipo/rails,bolek/rails,jeremy/rails,utilum/rails,alecspopa/rails,schuetzm/rails,88rabbit/newRails,amoody2108/TechForJustice,felipecvo/rails,mechanicles/rails,shioyama/rails,tgxworld/rails,betesh/rails,MSP-Greg/rails,kddeisz/rails,kenta-s/rails,gauravtiwari/rails,Edouard-chin/rails,yawboakye/rails,gcourtemanche/rails,illacceptanything/illacceptanything,ttanimichi/rails,pvalena/rails,iainbeeston/rails,joonyou/rails,arunagw/rails,lcreid/rails,georgeclaghorn/rails,sealocal/rails,Stellenticket/rails,brchristian/rails,BlakeWilliams/rails,Stellenticket/rails,Stellenticket/rails,MichaelSp/rails,mijoharas/rails,utilum/rails,kirs/rails-1,kaspth/rails,bolek/rails,mohitnatoo/rails,lucasmazza/rails,yalab/rails,yahonda/rails,Sen-Zhang/rails,arjes/rails,tgxworld/rails,untidy-hair/rails,palkan/rails,Sen-Zhang/rails,mathieujobin/reduced-rails-for-travis,samphilipd/rails,jeremy/rails,yalab/rails,baerjam/rails,illacceptanything/illacceptanything,hanystudy/rails,yasslab/railsguides.jp,starknx/rails,voray/rails,gcourtemanche/rails,88rabbit/newRails,prathamesh-sonpatki/rails,stefanmb/rails,maicher/rails,palkan/rails,esparta/rails,eileencodes/rails,kmcphillips/rails,gfvcastro/rails,richseviora/rails,schuetzm/rails,Erol/rails,rails/rails,yalab/rails,BlakeWilliams/rails,tgxworld/rails,Vasfed/rails,elfassy/rails,xlymian/rails,arjes/rails,starknx/rails,tjschuck/rails,prathamesh-sonpatki/rails,tijwelch/rails,iainbeeston/rails,yawboakye/rails,mtsmfm/rails,tjschuck/rails,rossta/rails,kachick/rails,illacceptanything/illacceptanything,esparta/rails,vipulnsward/rails,kaspth/rails,fabianoleittes/rails,aditya-kapoor/rails,Erol/rails,rafaelfranca/omg-rails,gcourtemanche/rails,felipecvo/rails,joonyou/rails,printercu/rails,illacceptanything/illacceptanything,amoody2108/TechForJustice,esparta/rails,kachick/rails,mtsmfm/railstest,gauravtiwari/rails,repinel/rails,mechanicles/rails,lcreid/rails,lucasmazza/rails,stefanmb/rails,illacceptanything/illacceptanything,lcreid/rails,alecspopa/rails,travisofthenorth/rails