farther along towards getting the specs to pass
This commit is contained in:
parent
17a2c9e311
commit
17dde3a7b9
2 changed files with 5 additions and 5 deletions
|
|
@ -23,8 +23,8 @@ class Notification < ActiveRecord::Base
|
||||||
else
|
else
|
||||||
n = make_notification(recipient, target, actor, action)
|
n = make_notification(recipient, target, actor, action)
|
||||||
end
|
end
|
||||||
n.email_the_user(actor) if n
|
n.email_the_user(target, actor) if n
|
||||||
n.socket_to_uid(user, :actor => person) if n
|
n.socket_to_user(recipient, :actor => actor) if n
|
||||||
n
|
n
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -48,7 +48,7 @@ private
|
||||||
if n = Notification.where(:target_id => target.id,
|
if n = Notification.where(:target_id => target.id,
|
||||||
:action => action,
|
:action => action,
|
||||||
:recipient_id => recipient.id).first
|
:recipient_id => recipient.id).first
|
||||||
n.actors << NotificationActor.new(:actor => actor)
|
n.actors << actor
|
||||||
n.save!
|
n.save!
|
||||||
n
|
n
|
||||||
else
|
else
|
||||||
|
|
@ -60,7 +60,7 @@ private
|
||||||
n = Notification.new(:target_id => target.id,
|
n = Notification.new(:target_id => target.id,
|
||||||
:action => action,
|
:action => action,
|
||||||
:recipient_id => recipient.id)
|
:recipient_id => recipient.id)
|
||||||
n.actors << NotificationActor.new(:actor => actor)
|
n.actors << actor
|
||||||
n.save!
|
n.save!
|
||||||
n
|
n
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,6 @@ class Person < ActiveRecord::Base
|
||||||
Post.where(:person_id => id).delete_all
|
Post.where(:person_id => id).delete_all
|
||||||
Comment.where(:person_id => id).delete_all
|
Comment.where(:person_id => id).delete_all
|
||||||
Contact.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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue