Changeset 4459
- Timestamp:
- 06/19/06 16:45:34 (2 years ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/base.rb (modified) (1 diff)
- trunk/activerecord/test/base_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r4437 r4459 1 1 *SVN* 2 3 * Change AR::Base#to_param to return a String instead of a Fixnum. Closes #5320. [Nicholas Seckar] 2 4 3 5 * Use explicit delegation instead of method aliasing for AR::Base.to_param -> AR::Base.id. #5299 (skaes@web.de) trunk/activerecord/lib/active_record/base.rb
r4437 r4459 1411 1411 # Enables Active Record objects to be used as URL parameters in Action Pack automatically. 1412 1412 def to_param 1413 # can't use alias_method here, because method 'id' optimizes itself on the fly1414 id 1413 # We can't use alias_method here, because method 'id' optimizes itself on the fly. 1414 id.to_s if id # Be sure to stringify the id for routes 1415 1415 end 1416 1416 trunk/activerecord/test/base_test.rb
r4431 r4459 1317 1317 assert_equal '::Person', ActiveRecord::Base.send(:type_name_with_module, '::Person') 1318 1318 end 1319 1320 def test_to_param_should_return_string 1321 assert_kind_of String, Client.find(:first).to_param 1322 end 1319 1323 1320 1324 # FIXME: this test ought to run, but it needs to run sandboxed so that it