diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-21 08:47:37 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-21 09:08:59 +0100 |
commit | 9dd67fce25d3993a0ee494506ba246a45d395e3f (patch) | |
tree | 4185a25a3be50de5fcd29d387782145d49cd1dcc /activerecord | |
parent | f81c6bc0404ba2a03eed0ec6c08bbac45661305f (diff) | |
download | rails-9dd67fce25d3993a0ee494506ba246a45d395e3f.tar.gz rails-9dd67fce25d3993a0ee494506ba246a45d395e3f.tar.bz2 rails-9dd67fce25d3993a0ee494506ba246a45d395e3f.zip |
Add to_key and to_param methods to ActiveModel::Conversion.
Diffstat (limited to 'activerecord')
-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 8549414a12..095814b635 100644 --- a/activerecord/lib/active_record/attribute_methods/primary_key.rb +++ b/activerecord/lib/active_record/attribute_methods/primary_key.rb @@ -50,7 +50,7 @@ module ActiveRecord # This method also takes custom primary keys specified via # the +set_primary_key+ into account. def to_key - new_record? ? nil : [ self.send(self.class.primary_key) ] + new_record? ? nil : [ self.primary_key ] end end |