Skip to content
Browse files

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
  • Loading branch information...
1 parent ea30f73 commit cffd1a9c3ac74dfd45dfef573b8592408f83481c @seckar seckar committed Jan 22, 2006
Showing with 10 additions and 0 deletions.
  1. +2 −0 activerecord/CHANGELOG
  2. +8 −0 activerecord/lib/active_record/connection_adapters/db2_adapter.rb
View
2 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]
View
8 activerecord/lib/active_record/connection_adapters/db2_adapter.rb
@@ -219,4 +219,12 @@ def select(sql, name = nil)
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

0 comments on commit cffd1a9

Please sign in to comment.
Something went wrong with that request. Please try again.