diff --git a/app/models/friend_request.rb b/app/models/friend_request.rb index a977144a0..3c9cd0e0c 100644 --- a/app/models/friend_request.rb +++ b/app/models/friend_request.rb @@ -26,7 +26,7 @@ class FriendRequest end def send_off - push_to [self.recipient] + push_to_recipient self.recipient end end diff --git a/lib/common.rb b/lib/common.rb index 786a711c5..aa4034dcf 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -66,6 +66,11 @@ module Diaspora end end + def push_to_recipient(recipient) + if self.sender_id == User.first.id + push_to( [recipient] ) + end + end def prep_webhook "#{self.to_xml.to_s}" diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 22a9d8c37..f5aae374a 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -24,6 +24,7 @@ namespace :db do User.delete_all Friend.delete_all Profile.delete_all + FriendRequest.delete_all end desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb'