aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-10-20 15:53:11 +0100
committerFrancis Irving <francis@mysociety.org>2010-10-20 15:53:11 +0100
commite36720f39d8e8e89f5adf396aa76cd2509574da3 (patch)
tree9207eec1b257ef681059bf4042267859be82f434 /app/models/user.rb
parent095efc46d2a029b4a72a25c0998adc09f8284e5f (diff)
Factor out some of the JSON generation
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 847959ce7..7f85a2c4f 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -326,6 +326,17 @@ class User < ActiveRecord::Base
return text
end
+ def json_for_api
+ return {
+ :id => self.id,
+ :url_name => self.url_name,
+ :name => self.name,
+ :ban_text => self.ban_text,
+ :about_me => self.about_me,
+ # :profile_photo => self.profile_photo # ought to have this, but too hard to get URL out for now
+ # created_at / updated_at we only show the year on the main page for privacy reasons, so don't put here
+ }
+ end
private