This project is archived and is in readonly mode.

#1033 ✓resolved

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

Reported by adevadeh | September 12th, 2008 @ 11:09 AM | in 2.x

this is copied over from Trac, where it was never applied:

The following association fails when a block extension is specified:

module Widdle
  class Foo
    has_many :bars do
      def do_something

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.

Comments and changes to this ticket

  • Rick

    Rick September 20th, 2008 @ 09:56 PM

    • State changed from “new” to “resolved”
    • Tag changed from activerecord to activerecord

    Pushed to master and 2-1-stable

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket