public
Description: simple identity map for active record. eager loading associations FTL
Clone URL: git://github.com/technoweenie/active_record_context.git
Click here to lend your support to: active_record_context and make a donation at www.pledgie.com !
technoweenie (author)
Sat Nov 25 22:50:21 -0800 2006
active_record_context / test / abstract_unit.rb
100644 21 lines (16 sloc) 0.732 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$:.unshift(File.dirname(__FILE__) + '/../lib')
$:.unshift(File.dirname(__FILE__) + '/../../../rails/activesupport/lib')
$:.unshift(File.dirname(__FILE__) + '/../../../rails/activerecord/lib')
 
require 'test/unit'
require 'active_support'
require 'active_record'
require 'active_record/fixtures'
require 'technoweenie/active_record_context'
 
config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log")
ActiveRecord::Base.establish_connection(config[ENV['DB'] || 'sqlite'])
 
load(File.dirname(__FILE__) + "/schema.rb")
 
ActiveRecord::Base.send :extend, Technoweenie::ActiveRecordContext
 
class Foo < ActiveRecord::Base
  set_table_name 'foo'
end