diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2014-08-07 16:10:20 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2014-08-07 16:10:20 -0700 |
commit | 089661b69ad055cab68ea860c085c7f852da3972 (patch) | |
tree | a39fe35f3c399b199bdca8490724b451761a1cba /activerecord/test/cases/primary_keys_test.rb | |
parent | cc1de71bfaced172fe00a66fd381da69d9528e8b (diff) | |
parent | e81453ef92b37156dafc092093106c8e8b87b268 (diff) | |
download | rails-089661b69ad055cab68ea860c085c7f852da3972.tar.gz rails-089661b69ad055cab68ea860c085c7f852da3972.tar.bz2 rails-089661b69ad055cab68ea860c085c7f852da3972.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activerecord/test/cases/primary_keys_test.rb')
-rw-r--r-- | activerecord/test/cases/primary_keys_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index b04df7ce43..f19a6ea5e3 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -5,6 +5,7 @@ require 'models/subscriber' require 'models/movie' require 'models/keyboard' require 'models/mixed_case_monkey' +require 'models/dashboard' class PrimaryKeysTest < ActiveRecord::TestCase fixtures :topics, :subscribers, :movies, :mixed_case_monkeys @@ -164,6 +165,15 @@ class PrimaryKeysTest < ActiveRecord::TestCase MixedCaseMonkey.reset_primary_key assert_equal "monkeyID", MixedCaseMonkey.primary_key end + + def test_primary_key_update_with_custom_key_name + dashboard = Dashboard.create!(dashboard_id: '1') + dashboard.id = '2' + dashboard.save! + + dashboard = Dashboard.first + assert_equal '2', dashboard.id + end end class PrimaryKeyWithNoConnectionTest < ActiveRecord::TestCase |