aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/CHANGELOG2
-rw-r--r--activerecord/lib/active_record/connection_adapters/db2_adapter.rb8
2 files changed, 10 insertions, 0 deletions
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