Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
Fix code that's broken by rails 6.1 breaking changes. Fixes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
betesh committed Dec 22, 2020
1 parent 722ae5f commit dc6ad1a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/active_record/postgres/constraints/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ class Railtie < ::Rails::Railtie
engine = self
ActiveSupport.on_load(:active_record) do
AR_CAS = ::ActiveRecord::ConnectionAdapters
AR_CAS_SCHEMA_CREATION = if defined?(AR_CAS::AbstractAdapter::SchemaCreation)
AR_CAS::AbstractAdapter::SchemaCreation
else
AR_CAS::SchemaCreation
end

engine.apply_patch! if engine.pg?
end
Expand All @@ -20,7 +25,7 @@ def apply_patch!
end
AR_CAS::TableDefinition.include TableDefinition
AR_CAS::PostgreSQLAdapter.include PostgreSQLAdapter
AR_CAS::AbstractAdapter::SchemaCreation.prepend SchemaCreation
AR_CAS_SCHEMA_CREATION.prepend SchemaCreation

::ActiveRecord::Migration::CommandRecorder.include CommandRecorder
::ActiveRecord::SchemaDumper.prepend SchemaDumper
Expand Down

0 comments on commit dc6ad1a

Please sign in to comment.