From cffd1a9c3ac74dfd45dfef573b8592408f83481c Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Sun, 22 Jan 2006 06:28:49 +0000 Subject: Show a meaningful error when the DB2 adapter cannot be loaded due to missing dependencies. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3460 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/CHANGELOG | 2 ++ activerecord/lib/active_record/connection_adapters/db2_adapter.rb | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 2cb721b1a2..3b17ea2118 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Show a meaningful error when the DB2 adapter cannot be loaded due to missing dependencies. [Nicholas Seckar] + * Make .count work for has_many associations with multi line finder sql [schoenm@earthlink.net] * Add AR::Base.base_class for querying the ancestor AR::Base subclass [Jamis Buck] diff --git a/activerecord/lib/active_record/connection_adapters/db2_adapter.rb b/activerecord/lib/active_record/connection_adapters/db2_adapter.rb index 7e3627261a..515444a21e 100644 --- a/activerecord/lib/active_record/connection_adapters/db2_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/db2_adapter.rb @@ -219,4 +219,12 @@ begin end rescue LoadError # DB2 driver is unavailable. + module ActiveRecord # :nodoc: + class Base # :nodoc: + def self.db2_connection(config) # :nodoc: + # Set up a reasonable error message + raise LoadError, "DB2 Libraries could not be loaded." + end + end + end end -- cgit v1.2.3