diff options
author | Adeh DeSandies <adeh@yahoo.com> | 2008-09-12 18:02:40 +0800 |
---|---|---|
committer | rick <technoweenie@gmail.com> | 2008-09-20 13:46:09 -0700 |
commit | de96a8666d8edc9be57f6146e587a71d23dbeb41 (patch) | |
tree | 641cb4fe91bab52207dc25ba16e91006c0044655 /activerecord/test | |
parent | 22e830f883af0b56de81186c184751b6398d0141 (diff) | |
download | rails-de96a8666d8edc9be57f6146e587a71d23dbeb41.tar.gz rails-de96a8666d8edc9be57f6146e587a71d23dbeb41.tar.bz2 rails-de96a8666d8edc9be57f6146e587a71d23dbeb41.zip |
applied patch to fix the associations with blocks in modules bug from an old trac ticket
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/extension_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/extension_test.rb b/activerecord/test/cases/associations/extension_test.rb index 5c01c3c1f5..9390633d5b 100644 --- a/activerecord/test/cases/associations/extension_test.rb +++ b/activerecord/test/cases/associations/extension_test.rb @@ -3,6 +3,7 @@ require 'models/post' require 'models/comment' require 'models/project' require 'models/developer' +require 'models/company_in_module' class AssociationsExtensionsTest < ActiveRecord::TestCase fixtures :projects, :developers, :developers_projects, :comments, :posts @@ -44,4 +45,18 @@ class AssociationsExtensionsTest < ActiveRecord::TestCase david = Marshal.load(Marshal.dump(david)) assert_equal projects(:action_controller), david.projects_extended_by_name.find_most_recent end + + + def test_extension_name + extension = Proc.new {} + name = :association_name + + assert_equal 'DeveloperAssociationNameAssociationExtension', Developer.send(:create_extension_modules, name, extension, []).first.name + assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension', +MyApplication::Business::Developer.send(:create_extension_modules, name, extension, []).first.name + assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension', MyApplication::Business::Developer.send(:create_extension_modules, name, extension, []).first.name + assert_equal 'MyApplication::Business::DeveloperAssociationNameAssociationExtension', MyApplication::Business::Developer.send(:create_extension_modules, name, extension, []).first.name + end + + end |