Skip to content

Commit

Permalink
Merge branch 'upstream-v334' into upgrade-to-upstream-3-3-4
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanitoFatas committed Oct 22, 2024
2 parents f437383 + 9a96bf7 commit 296f9bc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
include:
- ruby: 3.2
gemfile: gemfiles/activerecord71.gemfile
postgres: 15
postgres: 16
- ruby: 3.1
gemfile: Gemfile
postgres: 14
postgres: 15
- ruby: "3.0"
gemfile: gemfiles/activerecord61.gemfile
postgres: 12
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 7 additions & 2 deletions lib/pghero.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/pghero/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PgHero
VERSION = "3.3.3"
VERSION = "3.3.4"
end

0 comments on commit 296f9bc

Please sign in to comment.