From f62b8af6883188bf340e27b2789b34a2fe0730b9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 2 Mar 2006 01:37:41 +0000 Subject: 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 --- .../lib/active_record/connection_adapters/sybase_adapter.rb | 8 ++++++-- 1 file 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 -- cgit v1.2.3