app/models/user.rb
# Retrive list of user tables from database catalogue
#
# You can use this to check for dangling records in the
# admin db "user_tables" table.
#
# NOTE: this currently returns all public tables, can be
#       improved to skip "service" tables
#
Retrive list of user tables from database catalogue
You can use this to check for dangling records in the
admin db "user_tables" table.

this currently returns all public tables, can be
improved to skip "service" tables
Retrive list of user tables from database catalogue You can use this to check for dangling records in the admin db " user_tables " table . this currently returns all public tables can be improved to skip " service " tables
def tables_effective()
    in_database do |user_database|
      user_database.synchronize do |conn|
        query = "select table_name::text from information_schema.tables where table_schema = 'public'"
        tables = user_database[query].all.map { |i| i[:table_name] }
        return tables
      end
    end
  end
def tables_effective ( ) in_database do | user_database | user_database . synchronize do | conn | query = "select table_name::text from information_schema.tables where table_schema = 'public'" tables = user_database [ query ] . all . map { | i | i [ :table_name ] } return tables end end end
Retrive list of user tables from database catalogue
You can use this to check for dangling records in the
admin db "user_tables" table.
Retrive list of user tables from database catalogue You can use this to check for dangling records in the admin db " user_tables " table .