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

Ticket #10373 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

[PATCH][DOCS] Document AR::B attribute query methods

Reported by: chuyeow Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: docs
Cc:

Description

I wasn't aware of that AR::B defined attribute query methods until I read this blog post.

E.g.

user = User.new(:name => "David")
user.name? # => true

anonymous = User.new(:name => "")
 anonymous.name? # => false

This patch simply adds documentation of the existence of these "magic" methods. Seeing as these methods are dynamically defined in attribute_methods.rb I could only think of putting them in AR::B's rdoc so they'd appear somewhere logical - if somewhere else is better please do suggest.

Attachments

document_ar_b_query_methods.diff (1.2 kB) - added by chuyeow on 12/05/07 11:58:22.

Change History

12/05/07 11:58:22 changed by chuyeow

  • attachment document_ar_b_query_methods.diff added.

12/05/07 14:22:29 changed by marcel

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

(In [8280]) Document automatically generated predicate methods for attributes. Closes #10373 [chuyeow]