Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Deletion
- def execute
- user.logout
- user.after_destroy_hook do
- self.executed_at = Time.now
- save_changes(:validate => false)
- end
- user.destroy
- end
- end
- class User
- def before_destroy
- self.inbox = nil # so foreign_key doesnt complain when mailboxes are destroyed
- save_changes(:validate => false)
- super
- end
- end
Add Comment
Please, Sign In to add comment