Skip to content

Commit

Permalink
Merge pull request #237 from ifad/bugfix/236-fix-rails-edge-compatibi…
Browse files Browse the repository at this point in the history
…lity

Connect to the database before checking PG version
  • Loading branch information
tagliala authored Oct 6, 2023
2 parents f98cdd0 + 6752d79 commit f7e9012
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/active_record/connection_adapters/chronomodel_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ def chronomodel_connection(config) # :nodoc:

adapter = ChronoModel::Adapter.new(conn, logger, conn_params, config)

# Rails 7.2.0, see ifad/chronomodel#236
adapter.connect! if adapter.respond_to?(:connect!)

unless adapter.chrono_supported?
raise ChronoModel::Error, 'Your database server is not supported by ChronoModel. ' \
'Currently, only PostgreSQL >= 9.3 is supported.'
Expand Down

0 comments on commit f7e9012

Please sign in to comment.