Class: AccountDeletion

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Diaspora::Federated::Base
Defined in:
app/models/account_deletion.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Methods included from Diaspora::Federated::Base

included

Instance Method Details

#diaspora_handle=(diaspora_handle) ⇒ Object


21
22
23
24
# File 'app/models/account_deletion.rb', line 21

def diaspora_handle=(diaspora_handle)
  self[:diaspora_handle] = diaspora_handle
  self[:person_id] ||= Person.find_by_diaspora_handle(diaspora_handle).id
end

#dispatchObject


39
40
41
# File 'app/models/account_deletion.rb', line 39

def dispatch
  Postzord::Dispatcher.build(person.owner, self).post
end

#perform!Object


30
31
32
33
# File 'app/models/account_deletion.rb', line 30

def perform!
  self.dispatch if person.local?
  AccountDeleter.new(self.diaspora_handle).perform!
end

#person=(person) ⇒ Object


16
17
18
19
# File 'app/models/account_deletion.rb', line 16

def person=(person)
  self[:diaspora_handle] = person.diaspora_handle
  self[:person_id] = person.id
end

#public?Boolean


43
44
45
# File 'app/models/account_deletion.rb', line 43

def public?
  true
end

#queue_delete_accountObject


26
27
28
# File 'app/models/account_deletion.rb', line 26

def 
  Workers::DeleteAccount.perform_async(self.id)
end

#subscribers(user) ⇒ Object


35
36
37
# File 'app/models/account_deletion.rb', line 35

def subscribers(user)
  person.owner.contact_people.remote | Person.who_have_reshared_a_users_posts(person.owner).remote
end