aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-01-16 01:31:25 +0000
committerMichael Koziarski <michael@koziarski.com>2007-01-16 01:31:25 +0000
commit8437be33801d598b3b3389163cb3082fb04b0ec8 (patch)
tree7404f8b908ec0280a548123e61c171713d055c5e /activerecord
parent6d37c638e7eaa3daa48fe0408016be625bc22ef6 (diff)
downloadrails-8437be33801d598b3b3389163cb3082fb04b0ec8.tar.gz
rails-8437be33801d598b3b3389163cb3082fb04b0ec8.tar.bz2
rails-8437be33801d598b3b3389163cb3082fb04b0ec8.zip
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
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb2
-rw-r--r--activerecord/lib/active_record/connection_adapters/oracle_adapter.rb5
2 files changed, 4 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index 5ae5362a6d..a98b26f554 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -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
diff --git a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb
index 01408933f4..b44510fd7d 100644
--- a/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb
@@ -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