aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-30 07:05:14 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-30 07:05:14 +0000
commitff6d2aae0a127bb99dcf9e7c4117b2cd0143c088 (patch)
treefd3b2a227ab760eb9bf41e2b32cfa756b746aaa9 /activerecord/lib/active_record/associations.rb
parent1f802968c5a803f649fc27c7295b01aef3af6514 (diff)
downloadrails-ff6d2aae0a127bb99dcf9e7c4117b2cd0143c088.tar.gz
rails-ff6d2aae0a127bb99dcf9e7c4117b2cd0143c088.tar.bz2
rails-ff6d2aae0a127bb99dcf9e7c4117b2cd0143c088.zip
Quickref for association methods. Closes #7723.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb43
1 files changed, 40 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index e4bde6fc13..c1e93116d5 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -101,9 +101,46 @@ module ActiveRecord
# adds a method with that name to its model, it will override the inherited method and break things.
# For instance, #attributes and #connection would be bad choices for association names.
#
- # == Example
- #
- # link:files/examples/associations.png
+ # == Auto-generated methods
+ #
+ # ===Singular associations (one-to-one)
+ # | | belongs_to |
+ # generated methods | belongs_to | :polymorphic | has_one
+ # ----------------------------------+------------+--------------+---------
+ # #other | X | X | X
+ # #other=(other) | X | X | X
+ # #build_other(attributes={}) | X | | X
+ # #create_other(attributes={}) | X | | X
+ # #other.create!(attributes={}) | | | X
+ # #other.nil? | X | X |
+ #
+ # ===Collection associations (one-to-many / many-to-many)
+ # | | | has_many
+ # generated methods | habtm | has_many | :through
+ # ----------------------------------+-------+----------+----------
+ # #others | X | X | X
+ # #others=(other,other,...) | X | X |
+ # #other_ids | X | X |
+ # #other_ids=(id,id,...) | X | X |
+ # #others<< | X | X | X
+ # #others.push | X | X | X
+ # #others.concat | X | X | X
+ # #others.build(attributes={}) | X | X | X
+ # #others.create(attributes={}) | X | X |
+ # #others.create!(attributes={}) | X | X | X
+ # #others.size | X | X |
+ # #others.length | X | X |
+ # #others.count | | X |
+ # #others.sum(args*,&block) | X | X | X
+ # #others.empty? | X | X |
+ # #others.clear | X | X |
+ # #others.delete(other,other,...) | X | X | X
+ # #others.delete_all | X | X |
+ # #others.destroy_all | X | X |
+ # #others.find(*args) | X | X | X
+ # #others.find_first | X | |
+ # #others.uniq | X | X |
+ # #others.reset | X | X | X
#
# == Cardinality and associations
#