From 17dde3a7b93afa7b50f3c5f7c2d2de562755d1d3 Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Sat, 29 Jan 2011 23:58:48 -0800 Subject: [PATCH] farther along towards getting the specs to pass --- app/models/notification.rb | 8 ++++---- app/models/person.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/notification.rb b/app/models/notification.rb index c34a1b3e9..1e887eb06 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -23,8 +23,8 @@ class Notification < ActiveRecord::Base else n = make_notification(recipient, target, actor, action) end - n.email_the_user(actor) if n - n.socket_to_uid(user, :actor => person) if n + n.email_the_user(target, actor) if n + n.socket_to_user(recipient, :actor => actor) if n n end end @@ -48,7 +48,7 @@ private if n = Notification.where(:target_id => target.id, :action => action, :recipient_id => recipient.id).first - n.actors << NotificationActor.new(:actor => actor) + n.actors << actor n.save! n else @@ -60,7 +60,7 @@ private n = Notification.new(:target_id => target.id, :action => action, :recipient_id => recipient.id) - n.actors << NotificationActor.new(:actor => actor) + n.actors << actor n.save! n end diff --git a/app/models/person.rb b/app/models/person.rb index 01d0474fb..742f8b4e4 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -186,6 +186,6 @@ class Person < ActiveRecord::Base Post.where(:person_id => id).delete_all Comment.where(:person_id => id).delete_all Contact.where(:person_id => id).delete_all - Notification.joins(:notification_actors).where(:notification_actors => {:actor_id => self}).delete_all + Notification.where(:actors => self).delete_all end end