From c4f12ede3f323fa423d8cad9e5be01a2aa4a56f6 Mon Sep 17 00:00:00 2001 From: Zack Olson Date: Mon, 20 Nov 2017 17:34:29 -0500 Subject: [PATCH] fix callbacks issue from connection verification --- lib/acts_as_archive/base/table.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/acts_as_archive/base/table.rb b/lib/acts_as_archive/base/table.rb index 5432ccc..fce7d83 100644 --- a/lib/acts_as_archive/base/table.rb +++ b/lib/acts_as_archive/base/table.rb @@ -7,9 +7,9 @@ def self.included(base) base.send :extend, ClassMethods base.send :include, InstanceMethods - if base.connection.class.to_s.include?('Mysql') + if base.connection_config[:adapter] == 'mysql' base.send :extend, ActsAsArchive::Base::Adapters::MySQL - elsif base.connection.class.to_s.include?('PostgreSQL') + elsif base.connection_config[:adapter] == 'postgresql' base.send :extend, ActsAsArchive::Base::Adapters::PostgreSQL else raise 'acts_as_archive does not support this database adapter'