diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-02 01:37:41 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-02 01:37:41 +0000 |
commit | f62b8af6883188bf340e27b2789b34a2fe0730b9 (patch) | |
tree | c9ad667e0466a21f0528737c9faf7830d4bcbd55 | |
parent | 5ba5dd68dadb76c05d6364be4b0b906ad9125bf2 (diff) | |
download | rails-f62b8af6883188bf340e27b2789b34a2fe0730b9.tar.gz rails-f62b8af6883188bf340e27b2789b34a2fe0730b9.tar.bz2 rails-f62b8af6883188bf340e27b2789b34a2fe0730b9.zip |
Catch requirement of Sybase adapter, if we cant, dont have it
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3737 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sybase_adapter.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb b/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb index d9395defef..d87045a7aa 100644 --- a/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb @@ -6,12 +6,13 @@ require 'active_record/connection_adapters/abstract_adapter' +begin +require 'sybsql' + module ActiveRecord class Base # Establishes a connection to the database that's used by all Active Record objects def self.sybase_connection(config) # :nodoc: - require_library_or_gem 'sybsql' - config = config.symbolize_keys username = config[:username] ? config[:username].to_s : 'sa' @@ -596,5 +597,8 @@ class Fixtures def allow_identity_inserts(table_name, enable) @connection.execute "SET IDENTITY_INSERT #{table_name} #{enable ? 'ON' : 'OFF'}" rescue nil end +end +rescue LoadError => cannot_require_sybase + # Couldn't load sybase adapter end
\ No newline at end of file |