aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index a60741fc21..b945d8d0bc 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -896,6 +896,9 @@ module ActiveRecord #:nodoc:
read_attribute(self.class.primary_key)
end
+ # Enables Active Record objects to be used as URL parameters in Action Pack automatically.
+ alias_method :to_param, :id
+
def id_before_type_cast #:nodoc:
read_attribute_before_type_cast(self.class.primary_key)
end