Ticket #146 (closed defect: invalid)

Opened 11 months ago

Last modified 10 months ago

Has_many :through Association Extensions Don't Work

Reported by: archengule Owned by: somebody
Priority: trivial Milestone:
Component: camping.rb Version:
Keywords: Cc:

Description

Adding association extensions to has_many :through relationships doesn't work. Something like

class Person < Base
has_many :books, :through => :libraries do
# Extending association...
end
end

raises: [NameError] wrong constant name Test::Models::ContributorBooksAssociationExtension

Change History

in reply to: ↑ description ; follow-up: ↓ 2   Changed 11 months ago by evanweaver

  • priority changed from minor to trivial

This is a Rails bug. Anonymous extensions in namespaces are broken. Put your extension in its own module and then use the :extend => key to refer to it instead of using a block.

in reply to: ↑ 1   Changed 10 months ago by archengule

  • status changed from new to closed
  • resolution set to invalid

Ah, okay. That works.

Note: See TracTickets for help on using tickets.