Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Support block association extensions in modules (from Trac #6450)

#1033

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.

Reported by adevadeh · September 12th, 2008 @ 11:09 AM

State: resolved
Milestone: 2.x
Assigned to: Rick Rick
Importance: none

Activity

  1. Rick
    Rick
    • State changed from new to resolved
    • Tag changed from activerecord to activerecord

    Pushed to master and 2-1-stable

    September 20th, 2008 @ 09:56 PM