lib,test: replace connection query() method with sync_exec{,_params}.
[mailshears.git] / lib / common / roundcube_plugin.rb
index b66c9f603cf2e4c665de427d33f6210108db3b1f..6d522bb371847e433906af3792f74545916bd7cc 100644 (file)
@@ -52,7 +52,7 @@ module RoundcubePlugin
     sql_query = 'SELECT username FROM users;'
 
     begin
-      connection.query(sql_query) do |result|
+      connection.sync_exec(sql_query) do |result|
         usernames = result.field_values('username')
       end
     ensure
@@ -79,7 +79,7 @@ module RoundcubePlugin
     sql_query = 'SELECT user_id FROM users WHERE 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
           user_id = result[0]['user_id']
         end