diff options
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index c90e4d2162..dee460d9c5 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1409,7 +1409,10 @@ module ActiveRecord #:nodoc: end # Enables Active Record objects to be used as URL parameters in Action Pack automatically. - alias_method :to_param, :id + def to_param + # can't use alias_method here, because method 'id' optimizes itself on the fly + id + end def id_before_type_cast #:nodoc: read_attribute_before_type_cast(self.class.primary_key) |