mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
#id is an alias for whatever the primary key is
This commit is contained in:
parent
40840aa9ea
commit
4c33d517d9
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@ module ActiveRecord
|
|||
|
||||
# Returns this record's primary key value wrapped in an Array if one is available
|
||||
def to_key
|
||||
key = send(self.class.primary_key)
|
||||
key = self.id
|
||||
[key] if key
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue