Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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/branches/stable@3461 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 4ae6f746129b920906403892c8cdbf1dc0e17c52 1 parent f999ab0
@seckar seckar authored
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]
+
* Fix case of VERSION option in migration docs. #3521 [Dawnthorn <peterh@sapros.com>]
* Fixed that saving a model with multiple habtm associations would only save the first one. #3244 [yanowitz-rubyonrails@quantumfoam.org, Florian Weber]
View
8 activerecord/lib/active_record/connection_adapters/db2_adapter.rb
@@ -189,4 +189,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
Please sign in to comment.
Something went wrong with that request. Please try again.