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

Ticket #7171 (closed defect: fixed)

Opened 1 year ago

Last modified 7 months ago

[PATCH] Small alias_attribute doc fix.

Reported by: tzaharia Assigned to: core
Priority: low Milestone: 2.x
Component: ActiveSupport Version: 1.2.0rc2
Severity: minor Keywords: alias_attribute docs
Cc:

Description

The example in the docs for ActiveSupport's alias_attribute() has Content and Email ActiveRecord models, but it looks like the Email model was intended to inheriet from the Content model:

  # Example:
  #
  #   class Content < ActiveRecord::Base
  #     # has a title attribute
  #   end
  #
  #   class Email < ActiveRecord::Base
  #     alias_attribute :subject, :title
  #   end
  #
  #   e = Email.find(1)
  #   e.title    # => "Superstars"
  #   e.subject  # => "Superstars"
  #   e.subject? # => true
  #   e.subject = "Megastars"
  #   e.title    # => "Megastars"

RDoc patch included, no tests needed.

Attachments

alias_attribute_doc_fix.diff (491 bytes) - added by tzaharia on 01/18/07 21:41:06.

Change History

01/18/07 21:41:06 changed by tzaharia

  • attachment alias_attribute_doc_fix.diff added.

02/24/07 18:18:44 changed by josh

  • keywords changed from alias_attribute to alias_attribute docs.

12/05/07 21:52:29 changed by marcel

  • status changed from new to closed.
  • resolution set to fixed.

(In [8312]) Fix incorrect superclass in documentation for alias_attribute. Closes #7171 [tzaharia]