diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-07-17 15:20:45 -0700 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-07-17 15:20:45 -0700 |
commit | d00b635242120f4262178909d93faf4473b1055e (patch) | |
tree | 8cf8e7908ed9b93d1a8786396a8d59c993558e87 | |
parent | d8745decaf59aad32aa2f09abdba99b8d0e48b31 (diff) | |
parent | 80f61259f927e5e37e7f7b0ce0da44da1dc84efe (diff) | |
download | rails-d00b635242120f4262178909d93faf4473b1055e.tar.gz rails-d00b635242120f4262178909d93faf4473b1055e.tar.bz2 rails-d00b635242120f4262178909d93faf4473b1055e.zip |
Merge pull request #7081 from jfirebaugh/to_param_regression_master
AR::Integration must be included after AM::Conversion
-rw-r--r-- | activerecord/lib/active_record/model.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/base_test.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/model.rb b/activerecord/lib/active_record/model.rb index 0015e3a567..fb3fb643ff 100644 --- a/activerecord/lib/active_record/model.rb +++ b/activerecord/lib/active_record/model.rb @@ -74,9 +74,9 @@ module ActiveRecord include Inheritance include Scoping include Sanitization - include Integration include AttributeAssignment include ActiveModel::Conversion + include Integration include Validations include CounterCache include Locking::Optimistic diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index e34f505a02..e4ba1c62c9 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1684,6 +1684,12 @@ class BasicsTest < ActiveRecord::TestCase assert_kind_of String, Client.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 |