Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8707

Show
Ignore:
Timestamp:
01/23/08 17:06:40 (1 year ago)
Author:
marcel
Message:

Indicate in documentation that newer version of AR support eager loading in polymorphic associations. Closes #10861 [fxn]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/lib/active_record/associations.rb

    r8675 r8707  
    488488    # before the actual model exists. 
    489489    # 
    490     # Eager loading is not possible with polymorphic associations. Given 
     490    # Eager loading is not supported with polymorphic associations up to (and including) 
     491    # version 2.0.2. Given 
    491492    # 
    492493    #   class Address < ActiveRecord::Base 
     
    500501    # will raise <tt>ActiveRecord::EagerLoadPolymorphicError</tt>. The reason is that the parent model's type 
    501502    # is a column value so its corresponding table name cannot be put in the FROM/JOIN clauses of that early query. 
     503    # 
     504    # In versions greater than 2.0.2 eager loading in polymorphic associations is supported 
     505    # thanks to a change in the overall preloading strategy. 
    502506    # 
    503507    # It does work the other way around though: if the <tt>User</tt> model is <tt>addressable</tt> you can eager load