Skip to content

Business intelligence made simple

Fixed deprecation warning with Active Record 6.1

Andrew Kane30c38af83175
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a6e4bd1..b61b33c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
## 2.4.1 (unreleased)
- Added cohorts for MySQL
+- Fixed deprecation warning with Active Record 6.1
## 2.4.0 (2020-12-15)
diff --git a/lib/blazer/adapters/sql_adapter.rb b/lib/blazer/adapters/sql_adapter.rb
index 9e3db5d8..f2d90a9e 100644
--- a/lib/blazer/adapters/sql_adapter.rb
+++ b/lib/blazer/adapters/sql_adapter.rb
@@ -226,6 +226,8 @@ module Blazer
"public"
elsif sqlserver?
"dbo"
+ elsif connection_model.respond_to?(:connection_db_config)
+ connection_model.connection_db_config.database
else
connection_model.connection_config[:database]
end