| Class | User |
| In: |
app/models/user.rb
|
| Parent: | ActiveRecord::Base |
Project iboard4 Author Andreas Altendorfer Copyright 2009 by Andreas Altendorfer
The User-Class uses AuthLogic
list all friends of your friendships-list when they found in inverse_friendships too
# File app/models/user.rb, line 32
32: def commited_friendships
33: return @commited_friendships if @commited_friendships
34: @commited_friendships = friendships.all.reject { |r|
35: inverse_friendships.find_by_user_id(r.friend_id).nil?
36: }
37: @commited_friendships
38: end
# File app/models/user.rb, line 71
71: def deliver_new_account_instructions(subject)
72: reset_perishable_token!
73: UserMailer.deliver_new_account_instructions(self,subject)
74: end
# File app/models/user.rb, line 66
66: def deliver_password_reset_instructions(subject)
67: reset_perishable_token!
68: UserMailer.deliver_password_reset_instructions(self,subject)
69: end
# File app/models/user.rb, line 58
58: def display_name_and_user
59: "#{fullname} (#{username})"
60: end
list all friendships which are not found in inverse_friendships
# File app/models/user.rb, line 41
41: def not_commited_friendships
42: return @not_commited_friendships if @not_commited_friendships
43: @not_commited_friendships = friendships.all.reject { |r|
44: ! inverse_friendships.find_by_user_id(r.friend_id).nil?
45: }
46: @not_commited_friendships
47: end
list friendships which you have not accepted yet
# File app/models/user.rb, line 50
50: def not_confirmed_friendships
51: return @not_confirmed_friendships if @not_confirmed_friendships
52: @not_confirmed_friendships = inverse_friendships.all.reject { |r|
53: ! friendships.find_by_friend_id(r.user_id).nil?
54: }
55: @not_confirmed_friendships
56: end