Fixing retractions on albums, adding back remove_from_view
This commit is contained in:
parent
2409fd3f20
commit
36f8289522
3 changed files with 5 additions and 3 deletions
|
|
@ -67,6 +67,6 @@ class Album
|
|||
end
|
||||
|
||||
def propagate_retraction
|
||||
Retraction.for(self).notify_people
|
||||
self.person.owner.retract(self)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue