Update application.rb
@pgconn is already defined, so lets us it
This commit is contained in:
parent
2f24829bc5
commit
6294c7e883
@ -149,7 +149,7 @@ class Application
|
|||||||
groups = []
|
groups = []
|
||||||
res = pg_exec "SELECT rolname, oid FROM pg_roles WHERE #{pg_groups_conf[:filter]}"
|
res = pg_exec "SELECT rolname, oid FROM pg_roles WHERE #{pg_groups_conf[:filter]}"
|
||||||
res.each do |tuple|
|
res.each do |tuple|
|
||||||
res2 = pg_exec "SELECT pr.rolname FROM pg_auth_members pam JOIN pg_roles pr ON pr.oid=pam.member WHERE pam.roleid=#{PG.escape(tuple[1])}"
|
res2 = pg_exec "SELECT pr.rolname FROM pg_auth_members pam JOIN pg_roles pr ON pr.oid=pam.member WHERE pam.roleid=#{@pgconn.escape_string(tuple[1])}"
|
||||||
member_names = res2.map{|row| row[0] }
|
member_names = res2.map{|row| row[0] }
|
||||||
group = PgRole.new tuple[0], member_names
|
group = PgRole.new tuple[0], member_names
|
||||||
log.info{ "found pg-group: #{group.name.inspect} with members: #{member_names.inspect}"}
|
log.info{ "found pg-group: #{group.name.inspect} with members: #{member_names.inspect}"}
|
||||||
|
Reference in New Issue
Block a user