3 require 'models/tagging'
6 class Post
< ActiveRecord
::Base
8 has_one
:tagging, :as => :taggable, :class_name => 'Tagging'
12 class EagerLoadIncludeFullStiClassNamesTest
< ActiveRecord
::TestCase
18 def generate_test_objects
19 post
= Namespaced
::Post.create( :title => 'Great stuff', :body => 'This is not', :author_id => 1 )
20 tagging
= Tagging
.create( :taggable => post
)
24 old
= ActiveRecord
::Base.store_full_sti_class
26 ActiveRecord
::Base.store_full_sti_class
= false
27 post
= Namespaced
::Post.find_by_title( 'Great stuff', :include => :tagging )
28 assert_nil post
.tagging
30 ActiveRecord
::Base.store_full_sti_class
= true
31 post
= Namespaced
::Post.find_by_title( 'Great stuff', :include => :tagging )
32 assert_equal
'Tagging', post
.tagging
.class.name
34 ActiveRecord
::Base.store_full_sti_class
= old