From 0ad1b746f05adda9254df0d6c578945afd576b7f Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Mon, 4 Apr 2005 06:48:42 +0000 Subject: [PATCH] Stubbed out another new ActiveRecord dependency --- config/environment.rb | 5 +++-- lib/active_record_stub.rb | 31 +++++++++++++++++++------------ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/config/environment.rb b/config/environment.rb index a5d621aa..67a7b633 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -51,8 +51,9 @@ require 'rubygems' unless File.directory?("#{RAILS_ROOT}/vendor/rails") require 'active_support' require 'action_controller' -require 'active_record_stub' -require 'instiki_errors' + +require_dependency 'instiki_errors' +require_dependency 'active_record_stub' # Environment specific configuration require_dependency "environments/#{RAILS_ENV}" diff --git a/lib/active_record_stub.rb b/lib/active_record_stub.rb index 9a3ec8a0..e577663d 100644 --- a/lib/active_record_stub.rb +++ b/lib/active_record_stub.rb @@ -2,22 +2,29 @@ # Since ActiveRecord may not be present in Instiki runtime environment, this # file provides a stub replacement for it -unless defined? ActiveRecord::Base - module ActiveRecord class Base # dependency in railties/lib/dispatcher.rb - def self.reset_column_information_and_inheritable_attributes_for_all_subclasses - # noop - end - - # dependency in actionpack/lib/action_controller/benchmarking.rb - def self.connected? - false - end - + def self.reset_column_information_and_inheritable_attributes_for_all_subclasses + # noop end + + # dependency in actionpack/lib/action_controller/benchmarking.rb + def self.connected? + false + end + + # dependency in actionpack/lib/action_controller/benchmarking.rb + def self.connection + return ConnectionStub + end + end -end \ No newline at end of file + module ConnectionStub + def self.reset_runtime + end + end + +end