From 949deedf08ae6c08b0c45a73693e0fbda291e09f Mon Sep 17 00:00:00 2001 From: Peter Marsh Date: Mon, 22 Sep 2014 20:13:21 +0100 Subject: 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. --- activerecord/lib/active_record/associations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') 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 :foreign_key. # [: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 -- cgit v1.2.3