this is copied over from Trac, where it was never applied:
http://dev.rubyonrails.org/ticke...
The following association fails when a block extension is
specified:
module Widdle
class Foo
has_many :bars do
def do_something
end
end
end
end
In this case, create_extension_module generates the name
Widdle::FooBarsAssociation and attempts to set that constant name
in Object. However, it should rather generate the name
FooBarsAssociation and set that constant name in the module Widdle.
This patch addresses the issue.
Also, this bug creates a concrete problem with acts_as_versioned
and Rails 2.1.1. I have rebased the patch to edge (it actually did
not need any changes) and reran the tests.