aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-06-19 16:45:34 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-06-19 16:45:34 +0000
commite5fc5aaffe0d97b73678d7edfcaca222f01aba69 (patch)
tree1daa62eaad823b718a2531e8a8b8861b9e2eecc9 /activerecord/lib/active_record
parentae0e1a0682c853d0cdc969a82cd23455b4d2ca3e (diff)
downloadrails-e5fc5aaffe0d97b73678d7edfcaca222f01aba69.tar.gz
rails-e5fc5aaffe0d97b73678d7edfcaca222f01aba69.tar.bz2
rails-e5fc5aaffe0d97b73678d7edfcaca222f01aba69.zip
Change AR::Base#to_param to return a String instead of a Fixnum. Closes #5320.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4459 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index dee460d9c5..fe528f514c 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1410,8 +1410,8 @@ module ActiveRecord #:nodoc:
# Enables Active Record objects to be used as URL parameters in Action Pack automatically.
def to_param
- # can't use alias_method here, because method 'id' optimizes itself on the fly
- id
+ # We can't use alias_method here, because method 'id' optimizes itself on the fly.
+ id.to_s if id # Be sure to stringify the id for routes
end
def id_before_type_cast #:nodoc: