]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/mailshears/plugins/agendav.rb
Don't cast the username to an int in the AgenDAV plugin.
[mailshears.git] / lib / mailshears / plugins / agendav.rb
index 6ea60a209d65e8f19aa4dfbdd7b15853e2b54289..9746f1ce91e7db76cec65dbe46c79e1fdbd69d2e 100644 (file)
@@ -22,7 +22,7 @@ class AgendavDb
   end
 
   def describe_account(account)
-    if user_exists(account)
+    if self.user_exists(account)
       return "Username: #{account}"
     else
       return 'User not found'
@@ -37,8 +37,8 @@ class AgendavDb
     # Delete the given username and any records in other tables
     # belonging to it.
 
-    sql_queries = ['DELETE FROM prefs WHERE username = $1::int;']
-    sql_queries << 'DELETE FROM shared WHERE user_from = $1::int;'
+    sql_queries = ['DELETE FROM prefs WHERE username = $1;']
+    sql_queries << 'DELETE FROM shared WHERE user_from = $1;'
 
     begin
       connection = PGconn.connect(@db_host,