Created
September 8, 2008 23:18
-
-
Save slant/9568 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def kill_them(c_id) | |
puts | |
puts "---------------------------------------------" | |
if (c = Customer.find_by_id(c_id)) | |
puts " " + c.name | |
puts "---------------------------------------------" | |
print " Delete this customer? (y/n): " | |
answer = gets.chomp | |
if answer == "y" | |
kill_customer(c) | |
puts Customer.find_by_id(c_id) ? " There was a problem deleting this customer." : " Customer successfully deleted." | |
elsif answer == "n" | |
puts " Alright. " + c.first_name + " is safe... for now." | |
else | |
puts " '" + answer.to_s + "' is not a valid entry." | |
end | |
else | |
puts " Customer not found" | |
end | |
puts "---------------------------------------------" | |
puts | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment