Permalink
Browse files

#id is an alias for whatever the primary key is

  • Loading branch information...
1 parent 40840aa commit 4c33d517d9f4e6312ab23398cfaa6ca5a6177315 @jonleighton jonleighton committed Nov 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/attribute_methods/primary_key.rb
@@ -5,7 +5,7 @@ module PrimaryKey
# 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

0 comments on commit 4c33d51

Please sign in to comment.