diff options
author | Peter Marsh <pete.d.marsh@gmail.com> | 2014-09-22 20:13:21 +0100 |
---|---|---|
committer | Peter Marsh <pete.d.marsh@gmail.com> | 2014-09-22 20:27:03 +0100 |
commit | 949deedf08ae6c08b0c45a73693e0fbda291e09f (patch) | |
tree | 44b84838d0582442db18962afe8d031f047fdb5e | |
parent | f4595e624babf939788ec07aa9497b1650c54c6c (diff) | |
download | rails-949deedf08ae6c08b0c45a73693e0fbda291e09f.tar.gz rails-949deedf08ae6c08b0c45a73693e0fbda291e09f.tar.bz2 rails-949deedf08ae6c08b0c45a73693e0fbda291e09f.zip |
Clarify the documentation of the primary_key option for associations
Previously the documentation stated that `primary_key` should be the name of
a *method* that returns the primary key used for the association. This is
incorrect. This changes the documentation to say that the value must be the
name of a column.
-rw-r--r-- | activerecord/lib/active_record/associations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 18da28d480..12ca3a48a9 100644 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1171,7 +1171,7 @@ module ActiveRecord # of this class in lower-case and "_id" suffixed. So a Person class that makes a +has_many+ # association will use "person_id" as the default <tt>:foreign_key</tt>. # [:primary_key] - # Specify the method that returns the primary key used for the association. By default this is +id+. + # Specify the name of the column to use as the primary key for the association. By default this is +id+. # [:dependent] # Controls what happens to the associated objects when # their owner is destroyed. Note that these are implemented as |