title: to_json with conditional :except in rails
body: <p>I have a User model with an id, name and url attribute and an associated Preferences model with an id and show_my_url fields. </p>
  
  <p>I want to render my user as json but only include the url attribute if user.preferences.show_my_url is 'true'. </p>
  
  <p>How can i remove the users url attribute based on the preferences so that it´s not included in the to_json rendering. </p>