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
app/models/person.rb
... | ... | @@ -102,7 +102,10 @@ class Person < Profile |
102 | 102 | |
103 | 103 | def add_friend(friend, group = nil) |
104 | 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 | 109 | end |
107 | 110 | end |
108 | 111 | ... | ... |