File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 @hacker = Hacker . first ( :username => params [ :name ] )
2020
2121 #follow them!
22- Hacker . push_uniq ( current_user . id , :following => @hacker . email )
23- Hacker . push_uniq ( @hacker . id , :followers => current_user . email )
22+ Hacker . push_uniq ( current_user . id , :following => @hacker . id )
23+ Hacker . push_uniq ( @hacker . id , :followers => current_user . id )
2424
2525 #set a message
2626 flash [ :notice ] = "Now following #{ params [ :name ] } ."
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ class Hacker
1717 key :admin , Boolean , :default => false
1818
1919 #the list of emails this user is following
20- key :following , Array
20+ key :following , Array , :typecast => 'ObjectId'
2121
2222 #the list of emails of users that are following this user
23- key :followers , Array
23+ key :followers , Array , :typecast => 'ObjectId'
2424
2525 #we don't want to store the password (or the confirmation), so we just make an accessor
2626 attr_accessor :password , :password_confirmation
You can’t perform that action at this time.
0 commit comments