diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-08-17 00:20:55 +0300 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-08-16 22:26:11 +0100 |
commit | 96607996eaa826b5299780c7c9142e6e0157d198 (patch) | |
tree | bfe3d0a54a0d688c9d9df9c4b78040730b330e93 /activerecord/test/models | |
parent | 8cfdcdb35db6e2f6fd5a72a38f4352beab148af1 (diff) | |
download | rails-96607996eaa826b5299780c7c9142e6e0157d198.tar.gz rails-96607996eaa826b5299780c7c9142e6e0157d198.tar.bz2 rails-96607996eaa826b5299780c7c9142e6e0157d198.zip |
Test for eager loading of STI subclasses from htm associations
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/author.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/test/models/author.rb b/activerecord/test/models/author.rb index 136dc39cf3..c6aa0293c2 100644 --- a/activerecord/test/models/author.rb +++ b/activerecord/test/models/author.rb @@ -32,6 +32,9 @@ class Author < ActiveRecord::Base has_many :special_posts has_many :special_post_comments, :through => :special_posts, :source => :comments + has_many :sti_posts, :class_name => 'StiPost' + has_many :sti_post_comments, :through => :sti_posts, :source => :comments + has_many :special_nonexistant_posts, :class_name => "SpecialPost", :conditions => "posts.body = 'nonexistant'" has_many :special_nonexistant_post_comments, :through => :special_nonexistant_posts, :source => :comments, :conditions => "comments.post_id = 0" has_many :nonexistant_comments, :through => :posts |