mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Move active_record_unit to shared load path
This commit is contained in:
parent
ca72078388
commit
b7c031f52e
1 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@ if defined?(ActiveRecord) && defined?(Fixtures)
|
||||||
else
|
else
|
||||||
$stderr.print 'Attempting to load Active Record... '
|
$stderr.print 'Attempting to load Active Record... '
|
||||||
begin
|
begin
|
||||||
PATH_TO_AR = "#{File.dirname(__FILE__)}/../../activerecord/lib"
|
PATH_TO_AR = "#{File.dirname(__FILE__)}/../../../activerecord/lib"
|
||||||
raise LoadError, "#{PATH_TO_AR} doesn't exist" unless File.directory?(PATH_TO_AR)
|
raise LoadError, "#{PATH_TO_AR} doesn't exist" unless File.directory?(PATH_TO_AR)
|
||||||
$LOAD_PATH.unshift PATH_TO_AR
|
$LOAD_PATH.unshift PATH_TO_AR
|
||||||
require 'active_record'
|
require 'active_record'
|
||||||
|
@ -72,13 +72,13 @@ class ActiveRecordTestConnector
|
||||||
|
|
||||||
# Load actionpack sqlite tables
|
# Load actionpack sqlite tables
|
||||||
def load_schema
|
def load_schema
|
||||||
File.read(File.dirname(__FILE__) + "/fixtures/db_definitions/sqlite.sql").split(';').each do |sql|
|
File.read(File.dirname(__FILE__) + "/../fixtures/db_definitions/sqlite.sql").split(';').each do |sql|
|
||||||
ActiveRecord::Base.connection.execute(sql) unless sql.blank?
|
ActiveRecord::Base.connection.execute(sql) unless sql.blank?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def require_fixture_models
|
def require_fixture_models
|
||||||
Dir.glob(File.dirname(__FILE__) + "/fixtures/*.rb").each {|f| require f}
|
Dir.glob(File.dirname(__FILE__) + "/../fixtures/*.rb").each {|f| require f}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue