diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-10-28 13:31:34 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-10-29 01:59:04 -0200 |
commit | cdfa4a5f869b42fc3894e777d94b976ece28f716 (patch) | |
tree | b01de638cc45e782f0a807acf3d9c829c5711fe3 /activerecord/test | |
parent | 5d82c1fc56bedb3e0b736ec06b106b2989918978 (diff) | |
download | rails-cdfa4a5f869b42fc3894e777d94b976ece28f716.tar.gz rails-cdfa4a5f869b42fc3894e777d94b976ece28f716.tar.bz2 rails-cdfa4a5f869b42fc3894e777d94b976ece28f716.zip |
Merge pull request #8053 from henrik/update_columns_with_primary_key
Unbreak update_column/update_columns for the primary key attribute.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/persistence.rb
activerecord/test/cases/persistence_test.rb
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index e4b8caae52..66f884287d 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -505,6 +505,14 @@ class PersistencesTest < ActiveRecord::TestCase assert_equal 'super_title', t.title end + def test_update_column_changing_id + topic = Topic.find(1) + topic.update_column("id", 123) + assert_equal 123, topic.id + topic.reload + assert_equal 123, topic.id + end + def test_update_attributes topic = Topic.find(1) assert !topic.approved? |