diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-30 14:16:30 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-30 23:18:40 +0000 |
commit | 4c33d517d9f4e6312ab23398cfaa6ca5a6177315 (patch) | |
tree | b478228c41ec66d932768266707c7fdf5fe275e4 /activerecord/lib | |
parent | 40840aa9eadac27b940a9af49e86778071efe59b (diff) | |
download | rails-4c33d517d9f4e6312ab23398cfaa6ca5a6177315.tar.gz rails-4c33d517d9f4e6312ab23398cfaa6ca5a6177315.tar.bz2 rails-4c33d517d9f4e6312ab23398cfaa6ca5a6177315.zip |
#id is an alias for whatever the primary key is
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/primary_key.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/primary_key.rb b/activerecord/lib/active_record/attribute_methods/primary_key.rb index 93dae3ff86..a5c2849844 100644 --- a/activerecord/lib/active_record/attribute_methods/primary_key.rb +++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb @@ -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 |