Permalink
Browse files

added unit test to reproduce error when rails config.cache_classes is

set to false. This is the case in development mode.

The problem occurs,when the proxy class (e.g TagTranslation) exists already
when gloablize wants to create it.
  • Loading branch information...
1 parent 52797c9 commit 420b227d88673b9a50b64bbda3a5fae0f5c826bd @phuesler phuesler committed with Sven Fuchs Oct 10, 2009
Showing with 7 additions and 0 deletions.
  1. +3 −0 test/data/models.rb
  2. +4 −0 test/model/active_record/translated_test.rb
View
@@ -1,3 +1,6 @@
+class PostTranslation < ActiveRecord::Base
+ def existing_method ; end
+end
class Post < ActiveRecord::Base
translates :subject, :content
validates_presence_of :subject
@@ -472,6 +472,10 @@ class Baz < ActiveRecord::Base
Post.locale = :en
assert_equal 'foo', post.subject_before_type_cast
end
+
+ test "don't override existing translation model" do
+ assert PostTranslation.new.respond_to?(:existing_method)
+ end
end
# TODO should validate_presence_of take fallbacks into account? maybe we need

0 comments on commit 420b227

Please sign in to comment.