]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/common/davical_plugin.rb
lib,test: replace connection query() method with sync_exec{,_params}.
[mailshears.git] / lib / common / davical_plugin.rb
index ba09770deee3eff9d8483f76d70e23a5f99dfb2e..06abbfa99e31844b6ae22c5190a828837e59862c 100644 (file)
@@ -55,7 +55,7 @@ module DavicalPlugin
     sql_query = 'SELECT username FROM usr WHERE user_no > 1;'
 
     begin
-      connection.query(sql_query) do |result|
+      connection.sync_exec(sql_query) do |result|
         usernames = result.field_values('username')
       end
     ensure
@@ -88,7 +88,7 @@ module DavicalPlugin
     sql_query += 'WHERE usr.username = $1;'
 
     begin
-      connection.query(sql_query, [user.to_s()]) do |result|
+      connection.sync_exec_params(sql_query, [user.to_s()]) do |result|
         if result.num_tuples > 0
           principal_id = result[0]['principal_id']
         end