fix up user model json output function
This commit is contained in:
parent
9afc8bc7c4
commit
3aaf501b03
1 changed files with 10 additions and 9 deletions
|
@ -50,15 +50,16 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json_for_autocomplete
|
def as_json_for_autocomplete
|
||||||
user = {}
|
json = {}
|
||||||
user['id'] = u.id
|
json['id'] = id
|
||||||
user['label'] = u.name
|
json['label'] = name
|
||||||
user['value'] = u.name
|
json['value'] = name
|
||||||
user['profile'] = u.image.url(:sixtyfour)
|
json['profile'] = image.url(:sixtyfour)
|
||||||
user['mapCount'] = u.maps.count
|
json['mapCount'] = maps.count
|
||||||
user['generation'] = u.generation
|
json['generation'] = generation
|
||||||
user['created_at'] = u.created_at.strftime("%m/%d/%Y")
|
json['created_at'] = created_at.strftime("%m/%d/%Y")
|
||||||
user['rtype'] = "mapper"
|
json['rtype'] = "mapper"
|
||||||
|
json
|
||||||
end
|
end
|
||||||
|
|
||||||
#generate a random 8 letter/digit code that they can use to invite people
|
#generate a random 8 letter/digit code that they can use to invite people
|
||||||
|
|
Loading…
Reference in a new issue