aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-01-22 06:28:49 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-01-22 06:28:49 +0000
commitcffd1a9c3ac74dfd45dfef573b8592408f83481c (patch)
tree08cba76a70eba0027f37e4bd0d666a3c31d3797a
parentea30f7353be3a977c5ea50d8efaa02acf26dd133 (diff)
downloadrails-cffd1a9c3ac74dfd45dfef573b8592408f83481c.tar.gz
rails-cffd1a9c3ac74dfd45dfef573b8592408f83481c.tar.bz2
rails-cffd1a9c3ac74dfd45dfef573b8592408f83481c.zip
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
-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