1
0
Fork 0
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:
Jon Leighton 2011-11-30 14:16:30 +00:00
parent 40840aa9ea
commit 4c33d517d9

View file

@ -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