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.

Add special AssociationReflection methods for creating association objects

#986

This patch adds special AssociationReflection methods for creating association objects, and modifies the code base to use those methods instead of creating association objects directly. This allows plugins to hook into association object creation behavior.

For example,

@reflection.klass.new(...)

now becomes

@reflection.build_association(...)

Is this patch simple enough to make it into 2.2?

Reported by Hongli Lai · September 6th, 2008 @ 06:45 PM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Hongli Lai
    Hongli Lai

    Here's the context: I'm building a plugin which adds sharding support to ActiveRecord. Suppose that there are multiple database shards. Upon creating a new association record, I want the association record to be saved into the correct database shard. And to do this I need to be able to hook into association record creation.

    September 9th, 2008 @ 07:34 PM

  2. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to open
    • Milestone cleared.

    September 9th, 2008 @ 09:11 PM

  3. Jeremy Kemper