]>
gitweb.michael.orlitzky.com - mailshears.git/blob - plugins/agendav.rb
3 require 'common/agendav_plugin'
12 def delete_account(account
)
13 # Delete the given username and any records in other tables
15 raise NonexistentAccountError
.new(account
) if not user_exists(account
)
17 sql_queries
= ['DELETE FROM prefs WHERE username = $1;']
18 sql_queries
<< 'DELETE FROM shared WHERE user_from = $1;'
21 connection
= PGconn
.connect(@db_host,
29 sql_queries
.each
do |sql_query
|
30 connection
.query(sql_query
, [account
])
36 # Pretend like we're database-agnostic in case we ever are.
37 raise DatabaseError
.new(e
)