mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
#id is an alias for whatever the primary key is
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user