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

Changeset 7873

Show
Ignore:
Timestamp:
10/14/07 05:32:57 (1 year ago)
Author:
rick
Message:

Add notes to documentation regarding attr_readonly behavior with counter caches and polymorphic associations. Closes #9835 [saimonmoore, rick]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activerecord/CHANGELOG

    r7872 r7873  
    11*SVN* 
     2 
     3* Add notes to documentation regarding attr_readonly behavior with counter caches and polymorphic associations.  Closes #9835 [saimonmoore, rick] 
    24 
    35* Observers can observe model names as symbols properly now.  Closes #9869  [queso] 
  • trunk/activerecord/lib/active_record/associations.rb

    r7824 r7873  
    776776      #   is used on the associate class (such as a +Post+ class). You can also specify a custom counter cache column by providing  
    777777      #   a column name instead of a +true+/+false+ value to this option (e.g., <tt>:counter_cache => :my_custom_counter</tt>.) 
     778      #   Note: Specifying a counter_cache will add it to that model's list of readonly attributes using #attr_readonly. 
    778779      # * <tt>:include</tt>  - specify second-order associations that should be eager loaded when this object is loaded. 
    779780      # * <tt>:polymorphic</tt> - specify this association is a polymorphic association by passing +true+. 
     781      #   Note: If you've enabled the counter cache, then you may want to add the counter cache attribute  
     782      #   to the attr_readonly list in the associated classes (e.g. class Post; attr_readonly :comments_count; end). 
    780783      # 
    781784      # Option examples: