Fixing retractions on albums, adding back remove_from_view

This commit is contained in:
Raphael 2010-08-18 10:03:37 -07:00
parent 2409fd3f20
commit 36f8289522
3 changed files with 5 additions and 3 deletions

View file

@ -67,6 +67,6 @@ class Album
end
def propagate_retraction
Retraction.for(self).notify_people
self.person.owner.retract(self)
end
end

View file

@ -25,7 +25,7 @@ class Person
timestamps!
after_destroy :remove_all_traces
before_destroy :remove_all_traces
before_validation :clean_url
validates_presence_of :email, :url, :profile, :serialized_key
validates_format_of :url, :with =>
@ -92,5 +92,6 @@ class Person
private
def remove_all_traces
Post.all(:person_id => id).each{|p| p.delete}
Album.all(:person_id => id).each{|p| p.delete}
end
end

View file

@ -91,6 +91,7 @@ class User
######### Posts and Such ###############
def retract( post )
post.socket_to_uid(self.id)
retraction = Retraction.for(post)
retraction.creator_signature = retraction.sign_with_key( encryption_key )
retraction.notify_people
@ -258,7 +259,7 @@ class User
self.save
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