Browse Source

Maintenance: Improve database name fetching to be compatible with docker.

(cherry picked from commit 9d15959a42b0a28dbe0fe1ef7384e1ce25ac9a34)

9d15959a Maintenance: Improve database name fetching to be compatible with docker.

Co-authored-by: Rolf Schmidt <rolf.schmidt@zammad.com>
Rolf Schmidt 5 months ago
parent
commit
ed48331cec
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/models/system_report/plugin/postgre_sql.rb

+ 1 - 1
app/models/system_report/plugin/postgre_sql.rb

@@ -6,7 +6,7 @@ class SystemReport::Plugin::PostgreSql < SystemReport::Plugin
   def fetch
     return if ActiveRecord::Base.connection.adapter_name != 'PostgreSQL'
 
-    database_name = Rails.configuration.database_configuration[Rails.env]['database']
+    database_name = ActiveRecord::Base.connection.current_database
     ActiveRecord::Base.connection.execute("
       SELECT version() as version,
       pg_database_size('#{ActiveRecord::Base.connection.quote_string(database_name)}') as database_size,