Commit 74589b8f050fe5b8467ec361b7862c830459f858
1 parent
86c2f5ee
Exists in
master
and in
29 other branches
Fix FriendsBlock unit test
Showing
2 changed files
with
5 additions
and
2 deletions
Show diff stats
app/models/friends_block.rb
@@ -14,7 +14,7 @@ class FriendsBlock < ProfileListBlock | @@ -14,7 +14,7 @@ class FriendsBlock < ProfileListBlock | ||
14 | 14 | ||
15 | def footer | 15 | def footer |
16 | owner_id = owner.identifier | 16 | owner_id = owner.identifier |
17 | - lambda do | 17 | + proc do |
18 | link_to s_('friends|View all'), :profile => owner_id, :controller => 'profile', :action => 'friends' | 18 | link_to s_('friends|View all'), :profile => owner_id, :controller => 'profile', :action => 'friends' |
19 | end | 19 | end |
20 | end | 20 | end |
app/models/person.rb
@@ -102,7 +102,10 @@ class Person < Profile | @@ -102,7 +102,10 @@ class Person < Profile | ||
102 | 102 | ||
103 | def add_friend(friend, group = nil) | 103 | def add_friend(friend, group = nil) |
104 | unless self.is_a_friend?(friend) | 104 | unless self.is_a_friend?(friend) |
105 | - self.friendships.build(:friend => friend, :group => group).save! | 105 | + friendship = self.friendships.build |
106 | + friendship.friend = friend | ||
107 | + friendship.group = group | ||
108 | + friendship.save | ||
106 | end | 109 | end |
107 | end | 110 | end |
108 | 111 |