From 44a7ef85eba5491aaef5a890ef2b44b111888d35 Mon Sep 17 00:00:00 2001 From: Raimonds Simanovskis Date: Fri, 5 Jun 2009 18:45:09 +0300 Subject: modifications to Oracle connection.rb setup --- .../test/connections/native_oracle/connection.rb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/activerecord/test/connections/native_oracle/connection.rb b/activerecord/test/connections/native_oracle/connection.rb index 23e9f8f9c6..c8183dc0fb 100644 --- a/activerecord/test/connections/native_oracle/connection.rb +++ b/activerecord/test/connections/native_oracle/connection.rb @@ -1,8 +1,13 @@ # gem "rsim-activerecord-oracle_enhanced-adapter" -gem "activerecord-oracle_enhanced-adapter", ">=1.2.0" +# gem "activerecord-oracle_enhanced-adapter", ">=1.2.1" # uses local copy of oracle_enhanced adapter -# $:.unshift("../../oracle-enhanced/lib") -# require 'active_record/connection_adapters/oracle_enhanced_adapter' +$:.unshift("../../oracle-enhanced/lib") +require 'active_record/connection_adapters/oracle_enhanced_adapter' +# gem "activerecord-jdbc-adapter" +# require 'active_record/connection_adapters/jdbc_adapter' + +# otherwise failed with silence_warnings method missing exception +require 'active_support/core_ext/kernel/reporting' print "Using Oracle\n" require_dependency 'models/course' @@ -20,6 +25,9 @@ ActiveRecord::Base.configurations = { :adapter => 'oracle_enhanced', :database => db, :host => "localhost", # used just by JRuby to construct JDBC connect string + # :adapter => "jdbc", + # :driver => "oracle.jdbc.driver.OracleDriver", + # :url => "jdbc:oracle:thin:@localhost:1521:#{db}", :username => 'arunit', :password => 'arunit', :emulate_oracle_adapter => true @@ -28,6 +36,9 @@ ActiveRecord::Base.configurations = { :adapter => 'oracle_enhanced', :database => db, :host => "localhost", # used just by JRuby to construct JDBC connect string + # :adapter => "jdbc", + # :driver => "oracle.jdbc.driver.OracleDriver", + # :url => "jdbc:oracle:thin:@localhost:1521:#{db}", :username => 'arunit2', :password => 'arunit2', :emulate_oracle_adapter => true @@ -37,6 +48,9 @@ ActiveRecord::Base.configurations = { ActiveRecord::Base.establish_connection 'arunit' Course.establish_connection 'arunit2' +# ActiveRecord::Base.connection.execute %q{alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS'} +# ActiveRecord::Base.connection.execute %q{alter session set nls_timestamp_format = 'YYYY-MM-DD HH24:MI:SS'} rescue nil + # for assert_queries test helper ActiveRecord::Base.connection.class.class_eval do IGNORED_SELECT_SQL = [/^select .*nextval/i, /^SAVEPOINT/, /^ROLLBACK TO SAVEPOINT/, /^RELEASE SAVEPOINT/, /^\s*select .* from all_tab_columns/im] -- cgit v1.2.3