]> gitweb.michael.orlitzky.com - mailshears.git/blobdiff - lib/common/roundcube_plugin.rb
mailshears.gemspec: update the version to 0.0.5.
[mailshears.git] / lib / common / roundcube_plugin.rb
index b66c9f603cf2e4c665de427d33f6210108db3b1f..2ba9a98aaf25865960b5ea94b40cbad10dfc595e 100644 (file)
@@ -19,7 +19,6 @@ module RoundcubePlugin
       :host     => cfg.roundcube_dbhost,
       :port     => cfg.roundcube_dbport,
       :options  => cfg.roundcube_dbopts,
-      :tty      => cfg.roundcube_dbtty,
       :dbname   => cfg.roundcube_dbname,
       :user     => cfg.roundcube_dbuser,
       :password => cfg.roundcube_dbpass }
@@ -52,7 +51,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 +78,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