Permalink
Browse files

add the latest sqlite and fix a bug

  • Loading branch information...
imajes committed Sep 18, 2008
1 parent 8869290 commit 740089007db76245eb43e532aafccad876bf8528
Showing with 7 additions and 5 deletions.
  1. +7 −5 leaves/heralder/controller.rb
  2. BIN leaves/heralder/data/jibot.sqlite
@@ -84,7 +84,7 @@ def def_command(stem, sender, reply_to, msg)
def forget_command(stem, sender, reply_to, msg)
str = msg.split
- nick = str[0].strip!
+ nick = str.first.strip
to_forget = str[2, str.length].join(" ")
return "You need to use ?forgetme to do that" if to_forget.nil? || to_forget.empty?
@@ -103,10 +103,12 @@ def forget_command(stem, sender, reply_to, msg)
# TODO: Fix "destroy *with* validations bug..."
def forgetme_command(stem, sender, reply_to, msg)
- #apparently .destroy here fails
- Definition.all(:nick => sender[:nick].strip).destroy!
-
- var :nick => sender[:nick].strip!
+
+ # iterate all defs and destroy
+ Definition.all(:nick => sender[:nick].strip).each do |d|
+ d.destroy
+ end
+ var :nick => sender[:nick].strip
end
private
Binary file not shown.

0 comments on commit 7400890

Please sign in to comment.