lib/pgbouncerhero/methods/basics.rb in pgbouncerhero-0.1.1 vs lib/pgbouncerhero/methods/basics.rb in pgbouncerhero-1.0.0
- old
+ new
@@ -1,14 +1,16 @@
module PgBouncerHero
module Methods
module Basics
def summary
- l = lists
- d = databases
- l = l.as_json
- d = d.as_json.reject { |a| a['name'] == 'pgbouncer' }
- l.push({databases_details: d})
- l
+ if connection
+ l = lists
+ d = databases
+ l = l.as_json
+ d = d.as_json.reject { |a| a['name'] == 'pgbouncer' }
+ l.push({databases_details: d})
+ l
+ end
end
def databases
connection.exec("SHOW databases")
end
def stats