Permalink
Browse files

Merge pull request #124 from phiggins/reload_from_database_not_working

#reload doesn't work when translated attribute has been updated in the database
  • Loading branch information...
2 parents 6699cdf + f77de02 commit a1a3deb2d99905aa8b7227c32e5d0f11fd74af17 @parndt parndt committed Mar 23, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/globalize3_test.rb
View
@@ -80,6 +80,17 @@ class Globalize3Test < Test::Unit::TestCase
assert_equal 'foo', post.title
end
+ test "reload works with translated attributes when updated elsewhere" do
+ post = Post.create(:title => 'foo')
+ post.title # make sure its fetched from the DB
+
+ Post.find_by_id(post.id).update_attributes! :title => 'bar'
+
+ post.reload
+
+ assert_equal 'bar', post.title
+ end
+
test "reload accepts standard finder options" do
post = Post.create(:title => "title")
assert post.reload(:readonly => true, :lock => true)

0 comments on commit a1a3deb

Please sign in to comment.