diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a43182c90..170cf1fe6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,22 +7,22 @@ jobs: fail-fast: false matrix: include: - - ruby: 3.2 + - ruby: 3.3 + gemfile: gemfiles/activerecord71.gemfile + postgres: 16 + - ruby: 3.3 gemfile: gemfiles/activerecord71.gemfile postgres: 15 - - ruby: 3.1 - gemfile: Gemfile + - ruby: 3.3 + gemfile: gemfiles/activerecord71.gemfile postgres: 14 - - ruby: "3.0" - gemfile: gemfiles/activerecord61.gemfile - postgres: 12 - - ruby: 2.7 - gemfile: gemfiles/activerecord60.gemfile - postgres: 10 + - ruby: 3.3 + gemfile: gemfiles/activerecord71.gemfile + postgres: 13 env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2daba879b..02398055d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.3.4 (2023-09-05) + +- Fixed support for aliases in config file + ## 3.3.3 (2023-04-18) - Fixed error with system stats for Azure Database diff --git a/lib/pghero.rb b/lib/pghero.rb index d2f4ba0e0..40affdbeb 100644 --- a/lib/pghero.rb +++ b/lib/pghero.rb @@ -121,7 +121,7 @@ def file_config config_file_exists = File.exist?(path) - config = YAML.safe_load(ERB.new(File.read(path)).result) if config_file_exists + config = YAML.safe_load(ERB.new(File.read(path)).result, aliases: true) if config_file_exists config ||= {} @file_config = @@ -151,7 +151,7 @@ def default_config if databases.empty? databases["primary"] = { - "url" => ENV["PGHERO_DATABASE_URL"] || connection_config(ActiveRecord::Base) + "url" => ENV["PGHERO_DATABASE_URL"] || default_connection_config } end @@ -168,6 +168,11 @@ def default_config } end + # private + def default_connection_config + connection_config(ActiveRecord::Base) if ActiveRecord::VERSION::STRING.to_f < 7.1 + end + # ensure we only have one copy of databases # so there's only one connection pool per database def databases diff --git a/lib/pghero/version.rb b/lib/pghero/version.rb index 6a476f46d..b23d29be7 100644 --- a/lib/pghero/version.rb +++ b/lib/pghero/version.rb @@ -1,3 +1,3 @@ module PgHero - VERSION = "3.3.3" + VERSION = "3.3.4" end