Skip to content
Browse files

Merge pull request #7080 from jfirebaugh/to_param_regression

AR::Integration must be included after AM::Conversion
  • Loading branch information...
2 parents 71d274d + 9b5309f commit 827f369fff52b9c3c802130ba59804465d1d14b5 @jonleighton jonleighton committed Jul 17, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/base.rb
  2. +6 −0 activerecord/test/cases/base_test.rb
View
2 activerecord/lib/active_record/base.rb
@@ -697,9 +697,9 @@ def to_ary # :nodoc:
include Scoping
extend DynamicMatchers
include Sanitization
- include Integration
include AttributeAssignment
include ActiveModel::Conversion
+ include Integration
include Validations
extend CounterCache
include Locking::Optimistic, Locking::Pessimistic
View
6 activerecord/test/cases/base_test.rb
@@ -1911,6 +1911,12 @@ def test_to_param_should_return_string
assert_kind_of String, Client.find(:first).to_param
end
+ def test_to_param_returns_id_even_if_not_persisted
+ client = Client.new
+ client.id = 1
+ assert_equal "1", client.to_param
+ end
+
def test_inspect_class
assert_equal 'ActiveRecord::Base', ActiveRecord::Base.inspect
assert_equal 'LoosePerson(abstract)', LoosePerson.inspect

0 comments on commit 827f369

Please sign in to comment.
Something went wrong with that request. Please try again.