Skip to content

Commit

Permalink
Eliminar todos los datos de usuario
Browse files Browse the repository at this point in the history
  • Loading branch information
Juantomas - GARUM Fundatio committed Feb 19, 2013
1 parent bbf3ce8 commit 8b4f279
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
22 changes: 22 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,27 @@ def deliver_password_reset_instructions!
Notifier.deliver_password_reset_instructions(self)
end

def self.borrarcuenta(id)

logger.debug "Borrando usuario: #{id}"
user = User.find(id)
if user.nil?
logger.debug "No existe esta cuenta"
return
end

logger.debug "Borramos información de la empresa"

compa = Bazarcms::Empresa.find_by_user_id(id)
if compa.nil?
logger.debug "No existe esta empresa"
return
else


# compa.delete
end

end

end
2 changes: 2 additions & 0 deletions app/models/usuario.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
class Usuario < ActiveRecord::Base
acts_as_authentic


end

0 comments on commit 8b4f279

Please sign in to comment.