From 7f7d98ce8a58d8cc66dd794cb3861fd269747dee Mon Sep 17 00:00:00 2001 From: Jeremy Hinegardner Date: Wed, 1 Feb 2012 16:21:51 -0700 Subject: [PATCH] Fix for running tests on activerecord 2.x --- Gemfile | 1 + test/abstract_db_create.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index b6a65985c..5a6ad6b9b 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source "http://rubygems.org" # This may wreak havoc on the lockfile, but we need a way to test # different AR versions gem 'activerecord', ENV['AR_VERSION'] +gem 'rails', ENV['AR_VERSION'] gem 'rake' diff --git a/test/abstract_db_create.rb b/test/abstract_db_create.rb index 2ca01bc81..271439f1d 100644 --- a/test/abstract_db_create.rb +++ b/test/abstract_db_create.rb @@ -83,7 +83,7 @@ def setup_rails2 ar_version = $LOADED_FEATURES.grep(%r{active_record/version}).first ar_lib_path = $LOAD_PATH.detect {|p| p if File.exist?File.join(p, ar_version)} ar_lib_path = ar_lib_path.sub(%r{activerecord/lib}, 'railties/lib') # edge rails - rails_lib_path = ar_lib_path.sub(/activerecord-([^\/]+)/, 'rails-\1') # gem rails + rails_lib_path = ar_lib_path.sub(/activerecord-([\d\.]+)/, 'rails-\1') # gem rails load "#{rails_lib_path}/tasks/databases.rake" end