diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-03-20 08:00:28 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2014-03-20 08:00:28 -0300 |
commit | 140ea2251b17ee9851e2511bf0a82a9e62197cd7 (patch) | |
tree | 9c45fec539f9b820e224c8c25f26153fff387288 /activerecord/test/cases/timestamp_test.rb | |
parent | eafec4694c5b37eff9d83b1188b8e331fa6027fa (diff) | |
parent | c80ca4c7803b4e8ed7f125ada9acc6b7c499af5f (diff) | |
download | rails-140ea2251b17ee9851e2511bf0a82a9e62197cd7.tar.gz rails-140ea2251b17ee9851e2511bf0a82a9e62197cd7.tar.bz2 rails-140ea2251b17ee9851e2511bf0a82a9e62197cd7.zip |
Merge pull request #14423 from yakko/persistence-touches-many
ActiveRecord#touch should accept multiple attributes
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/cases/timestamp_test.rb')
-rw-r--r-- | activerecord/test/cases/timestamp_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/timestamp_test.rb b/activerecord/test/cases/timestamp_test.rb index 717e0e1866..5308fa8808 100644 --- a/activerecord/test/cases/timestamp_test.rb +++ b/activerecord/test/cases/timestamp_test.rb @@ -89,6 +89,18 @@ class TimestampTest < ActiveRecord::TestCase assert_in_delta Time.now, task.ending, 1 end + def test_touching_many_attributes_updates_them + task = Task.first + previous_starting = task.starting + previous_ending = task.ending + task.touch(:starting, :ending) + + assert_not_equal previous_starting, task.starting + assert_not_equal previous_ending, task.ending + assert_in_delta Time.now, task.starting, 1 + assert_in_delta Time.now, task.ending, 1 + end + def test_touching_a_record_without_timestamps_is_unexceptional assert_nothing_raised { Car.first.touch } end |