Skip to content
Extraits de code Groupes Projets
Valider 36f82895 rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Fixing retractions on albums, adding back remove_from_view

parent 2409fd3f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -67,6 +67,6 @@ class Album ...@@ -67,6 +67,6 @@ class Album
end end
def propagate_retraction def propagate_retraction
Retraction.for(self).notify_people self.person.owner.retract(self)
end end
end end
...@@ -25,7 +25,7 @@ class Person ...@@ -25,7 +25,7 @@ class Person
timestamps! timestamps!
after_destroy :remove_all_traces before_destroy :remove_all_traces
before_validation :clean_url before_validation :clean_url
validates_presence_of :email, :url, :profile, :serialized_key validates_presence_of :email, :url, :profile, :serialized_key
validates_format_of :url, :with => validates_format_of :url, :with =>
...@@ -92,5 +92,6 @@ class Person ...@@ -92,5 +92,6 @@ class Person
private private
def remove_all_traces def remove_all_traces
Post.all(:person_id => id).each{|p| p.delete} Post.all(:person_id => id).each{|p| p.delete}
Album.all(:person_id => id).each{|p| p.delete}
end end
end end
...@@ -91,6 +91,7 @@ class User ...@@ -91,6 +91,7 @@ class User
######### Posts and Such ############### ######### Posts and Such ###############
def retract( post ) def retract( post )
post.socket_to_uid(self.id)
retraction = Retraction.for(post) retraction = Retraction.for(post)
retraction.creator_signature = retraction.sign_with_key( encryption_key ) retraction.creator_signature = retraction.sign_with_key( encryption_key )
retraction.notify_people retraction.notify_people
...@@ -258,7 +259,7 @@ class User ...@@ -258,7 +259,7 @@ class User
self.save self.save
groups = groups_with_person(object.person) groups = groups_with_person(object.person)
object.socket_to_uid(id, :group_id => groups.first.id) if (object.respond_to?(:socket_to_uid) && !self.owns?(object)) object.socket_to_uid(id, :group_id => group.id) if (object.respond_to?(:socket_to_uid) && !self.owns?(object))
end end
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter