mirror of
https://github.com/github/rails.git
synced 2026-02-03 18:55:29 -05:00
Improve handling of LoadErrors with the oracle adapter. Closes #6780 [kubo]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5956 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -265,7 +265,7 @@ module ActiveRecord
|
||||
column_type_sql << "(#{precision})"
|
||||
end
|
||||
else
|
||||
raise ArgumentError, "Error adding decimal column: precision cannot be empty if scale if specifed" if scale
|
||||
raise ArgumentError, "Error adding decimal column: precision cannot be empty if scale if specified" if scale
|
||||
end
|
||||
column_type_sql
|
||||
else
|
||||
|
||||
@@ -676,13 +676,14 @@ rescue LoadError
|
||||
# OCI8 driver is unavailable.
|
||||
module ActiveRecord # :nodoc:
|
||||
class Base
|
||||
@@oracle_error_message = "Oracle/OCI libraries could not be loaded: #{$!.to_s}"
|
||||
def self.oracle_connection(config) # :nodoc:
|
||||
# Set up a reasonable error message
|
||||
raise LoadError, "Oracle/OCI libraries could not be loaded."
|
||||
raise LoadError, @@oracle_error_message
|
||||
end
|
||||
def self.oci_connection(config) # :nodoc:
|
||||
# Set up a reasonable error message
|
||||
raise LoadError, "Oracle/OCI libraries could not be loaded."
|
||||
raise LoadError, @@oracle_error_message
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user