diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-10 23:49:57 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-10 23:49:57 +0000 |
commit | 3ff5c5805fb490591b5839db8445869a48e93bcb (patch) | |
tree | 78e56b855f5e005cd897f5ea00f6c7f07a9a6e41 /activerecord/test | |
parent | 59c2a4d51194058153b741b8682b1dd1b5e93939 (diff) | |
download | rails-3ff5c5805fb490591b5839db8445869a48e93bcb.tar.gz rails-3ff5c5805fb490591b5839db8445869a48e93bcb.tar.bz2 rails-3ff5c5805fb490591b5839db8445869a48e93bcb.zip |
Added Base#reload that reloads the attributes of an object from the database #422 [Andreas Schwarz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@376 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/base_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index ccd9152e60..119be8d868 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -620,4 +620,13 @@ class BasicsTest < Test::Unit::TestCase @topics["first"].find.toggle!(:approved) assert @topics["first"].find.approved? end -end
\ No newline at end of file + + def test_reload + t1 = Topic.find(1) + t2 = Topic.find(1) + t1.title = "something else" + t1.save + t2.reload + assert_equal t1.title, t2.title + end +end |