<p>In app/models/user.rb:</p>
<pre style='color:#555'>> @@ -222,6 +228,40 @@ def access_token(application_key)
> return ClientApplication.find_by_key(application_key).access_token_for_user(self)
> end
>
> +
> +public
> +
> + # Helpers for outputting only public data via JSON
> + cattr_accessor :public_fields
> + @@public_fields = [:id, :display_name]
> +
> + alias_method :ar_to_json, :to_json
</pre>
<p>You shouldn't need to use <code>alias_method</code> here - just use <code>super</code> when you want to pass the call on to the inherited version.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">
—<br>
Reply to this email directly or <a href='https://github.com/openstreetmap/openstreetmap-website/pull/54/files#r1358592'>view it on GitHub</a>.
</p>
<img src='https://github.com/notifications/beacon/uTRSc6ihLa7Shf84BpiOpmLWAu4oQih75mggZl1E8_ncpsL_vuCSTJlxIVuE64FQ.gif' height='1' width='1'>